MCPcopy Create free account
hub / github.com/YCAMInterlab/Duration / isNumber

Function isNumber

DurationRemote/src/testApp.cpp:87–93  ·  view source on GitHub ↗

number test from http://stackoverflow.com/questions/4654636/how-to-determine-if-a-string-is-a-number-with-c

Source from the content-addressed store, hash-verified

85
86//number test from http://stackoverflow.com/questions/4654636/how-to-determine-if-a-string-is-a-number-with-c
87bool isNumber(const string& s){
88 locale loc;
89 std::string::const_iterator it = s.begin();
90 while (it != s.end() && (std::isdigit(*it, loc) || *it == '.' || *it == '-')) ++it;
91 bool isnumber = !s.empty() && it == s.end();
92 return isnumber;
93}
94
95//--------------------------------------------------------------
96void testApp::guiEvent(ofxUIEventArgs &e){

Callers 2

guiEventMethod · 0.70
sendCurrentCommandMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected