Changeset 1339 for cpp/common/Convert.h


Ignore:
Timestamp:
05/06/25 23:04:33 (2 days ago)
Author:
Maciej Komosinski
Message:

Added two helper conversion functions: toDouble(), toUInt()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/Convert.h

    r1285 r1339  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2025  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1212#include <cmath>
    1313
    14 #ifdef LINUX
    15 #define UINT64_FORMAT "%llu" //we want to avoid this and ambiguous "long long", but gcc does not seem to support I64u (yet?)
    16 #else
    17 #define UINT64_FORMAT "%I64u"
    18 #endif
    1914
    2015struct Convert
     
    2217public:
    2318        static int toInt(string s);
     19        static unsigned int toUInt(string s);
    2420        static int toInt_HexIf0x(string s);
    2521        static float toFloat(string s);
     22        static double toDouble(string s);
    2623        static string toLowerCase(string s);
    2724        static string toUpperCase(string s);
Note: See TracChangeset for help on using the changeset viewer.