MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseDataFormat

Function ParseDataFormat

src/rest.cpp:140–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static RetFormat ParseDataFormat(std::string& param, const std::string& strReq)
141{
142 const std::string::size_type pos = strReq.rfind('.');
143 if (pos == std::string::npos)
144 {
145 param = strReq;
146 return rf_names[0].rf;
147 }
148
149 param = strReq.substr(0, pos);
150 const std::string suff(strReq, pos + 1);
151
152 for (const auto& rf_name : rf_names) {
153 if (suff == rf_name.name)
154 return rf_name.rf;
155 }
156
157 /* If no suffix is found, return original string. */
158 param = strReq;
159 return rf_names[0].rf;
160}
161
162static std::string AvailableDataFormatsString()
163{

Callers 10

rest_headersFunction · 0.85
rest_blockFunction · 0.85
rest_filter_headerFunction · 0.85
rest_block_filterFunction · 0.85
rest_chaininfoFunction · 0.85
rest_mempool_infoFunction · 0.85
rest_mempool_contentsFunction · 0.85
rest_txFunction · 0.85
rest_getutxosFunction · 0.85
rest_blockhash_by_heightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected