Changeset 691 for cpp/frams/util/sstringutils.cpp
- Timestamp:
- 09/04/17 03:24:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/sstringutils.cpp
r529 r691 7 7 #include <common/log.h> 8 8 #include <common/nonstd.h> 9 #include <common/Convert.h> 9 10 10 11 int loadSString(const char* filename, SString& s, const char* framsgmodule, const char* error, bool remove_cr) … … 19 20 } 20 21 else if (framsgmodule) 21 logPrintf(framsgmodule, "loadSString", LOG_WARN, error ? error : " can't open file \"%s\"", filename);22 logPrintf(framsgmodule, "loadSString", LOG_WARN, error ? error : "Can't open file \"%s\"", filename); 22 23 return ret; 23 24 } … … 323 324 } 324 325 326 SString getUIDString(uint64_t uid, char prefix) 327 { 328 return SString::sprintf("%c" UINT64_FORMAT, prefix, uid); 329 } 330 331 bool parseUIDString(const char* str, char prefix, uint64_t &uid, bool err) 332 { 333 if ((str[0] == prefix) && (isdigit(str[1]))) 334 { 335 char* end; 336 uid = strtoull(str + 1, &end, 10); 337 if (end == (str + 1 + strlen(str + 1))) 338 return true; 339 } 340 if (err) 341 logPrintf("SString", "parseUIDString", LOG_ERROR, "Invalid uid: '%s'", str); 342 return false; 343 }
Note: See TracChangeset
for help on using the changeset viewer.