SplitStr
This commit is contained in:
@@ -2109,7 +2109,8 @@ int32_t get_btcusd(uint32_t pricebits[4])
|
|||||||
|
|
||||||
int32_t komodo_cbopretsize(uint64_t flags)
|
int32_t komodo_cbopretsize(uint64_t flags)
|
||||||
{
|
{
|
||||||
int32_t size = 0;
|
int32_t size = 0; uint32_t cryptoprices[sizeof(Cryptos)/sizeof(*Cryptos)],forexprices[sizeof(Forex)/sizeof(*Forex)];
|
||||||
|
|
||||||
if ( (ASSETCHAINS_CBOPRET & 1) != 0 )
|
if ( (ASSETCHAINS_CBOPRET & 1) != 0 )
|
||||||
{
|
{
|
||||||
size = PRICES_SIZEBIT0;
|
size = PRICES_SIZEBIT0;
|
||||||
|
|||||||
@@ -1665,6 +1665,7 @@ uint64_t komodo_ac_block_subsidy(int nHeight)
|
|||||||
|
|
||||||
extern int64_t MAX_MONEY;
|
extern int64_t MAX_MONEY;
|
||||||
void komodo_cbopretupdate(int32_t forceflag);
|
void komodo_cbopretupdate(int32_t forceflag);
|
||||||
|
void SplitStr(const std::string& strVal, std::vector<std::string> outVals);
|
||||||
|
|
||||||
void komodo_args(char *argv0)
|
void komodo_args(char *argv0)
|
||||||
{
|
{
|
||||||
@@ -1814,9 +1815,9 @@ void komodo_args(char *argv0)
|
|||||||
ASSETCHAINS_CBOPRET = GetArg("-ac_cbopret",0);
|
ASSETCHAINS_CBOPRET = GetArg("-ac_cbopret",0);
|
||||||
if ( ASSETCHAINS_CBOPRET != 0 )
|
if ( ASSETCHAINS_CBOPRET != 0 )
|
||||||
{
|
{
|
||||||
Split(GetArg("-ac_prices",""), ASSETCHAINS_PRICES, 0);
|
SplitStr(GetArg("-ac_prices",""), ASSETCHAINS_PRICES);
|
||||||
for (i=0; i<ASSETCHAINS_PRICES.size(); i++)
|
for (i=0; i<ASSETCHAINS_PRICES.size(); i++)
|
||||||
fprintf(stderr,"%s ",ASSETCHAINS_PRICES[i]);
|
fprintf(stderr,"%s ",ASSETCHAINS_PRICES[i].c_str());
|
||||||
fprintf(stderr,"%d -ac_prices\n",(int32_t)ASSETCHAINS_PRICES.size());
|
fprintf(stderr,"%d -ac_prices\n",(int32_t)ASSETCHAINS_PRICES.size());
|
||||||
}
|
}
|
||||||
hexstr = GetArg("-ac_mineropret","");
|
hexstr = GetArg("-ac_mineropret","");
|
||||||
|
|||||||
23
src/util.cpp
23
src/util.cpp
@@ -394,6 +394,29 @@ void ParseParameters(int argc, const char* const argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SplitStr(const std::string& strVal, std::vector<std::string> outVals)
|
||||||
|
{
|
||||||
|
stringstream ss(strVal);
|
||||||
|
vector<std::string> str;
|
||||||
|
|
||||||
|
while ( ss.peek() == ' ' )
|
||||||
|
ss.ignore();
|
||||||
|
|
||||||
|
while ( ss >> str )
|
||||||
|
{
|
||||||
|
//outVals[numVals] = i;
|
||||||
|
outVals.push_back(i);
|
||||||
|
numVals += 1;
|
||||||
|
|
||||||
|
while ( ss.peek() == ' ' )
|
||||||
|
ss.ignore();
|
||||||
|
if ( ss.peek() == ',' )
|
||||||
|
ss.ignore();
|
||||||
|
while ( ss.peek() == ' ' )
|
||||||
|
ss.ignore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Split(const std::string& strVal, uint64_t *outVals, const uint64_t nDefault)
|
void Split(const std::string& strVal, uint64_t *outVals, const uint64_t nDefault)
|
||||||
{
|
{
|
||||||
stringstream ss(strVal);
|
stringstream ss(strVal);
|
||||||
|
|||||||
Reference in New Issue
Block a user