MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ParseDataFormat

Function ParseDataFormat

src/rest.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static RetFormat ParseDataFormat(std::string& param, const std::string& strReq)
72{
73 const std::string::size_type pos = strReq.rfind('.');
74 if (pos == std::string::npos)
75 {
76 param = strReq;
77 return rf_names[0].rf;
78 }
79
80 param = strReq.substr(0, pos);
81 const std::string suff(strReq, pos + 1);
82
83 for (unsigned int i = 0; i < ARRAYLEN(rf_names); i++)
84 if (suff == rf_names[i].name)
85 return rf_names[i].rf;
86
87 /* If no suffix is found, return original string. */
88 param = strReq;
89 return rf_names[0].rf;
90}
91
92static std::string AvailableDataFormatsString()
93{

Callers 7

rest_headersFunction · 0.85
rest_blockFunction · 0.85
rest_chaininfoFunction · 0.85
rest_mempool_infoFunction · 0.85
rest_mempool_contentsFunction · 0.85
rest_txFunction · 0.85
rest_getutxosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected