string_util.h 373 B

1234567891011121314151617181920212223
  1. #include "stdint.h"
  2. #include <string>
  3. using namespace std;
  4. static int64_t stringToint64(const string& strValue)
  5. {
  6. #ifdef WIN32
  7. return _atoi64(strValue.c_str());
  8. #else
  9. return atoll(strValue.c_str());
  10. #endif
  11. }
  12. static string int64Tostring(int64_t nValue)
  13. {
  14. char sz[100];
  15. #ifdef WIN32
  16. sprintf(sz, "%I64u", nValue);
  17. #else
  18. sprintf(sz, "%llu", nValue);
  19. #endif
  20. return sz;
  21. }