summaryrefslogtreecommitdiffstats
path: root/src/cppvalue.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-02-06 19:57:02 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-02-06 20:26:55 (GMT)
commit38fdb5cf1193c792153c139800c92c37a555f9d1 (patch)
tree6ad236162bfec727bab18f1e254642cb8b3fc15d /src/cppvalue.cpp
parent0c612fec125124a062b1ba26244631e334e328b7 (diff)
downloadDoxygen-38fdb5cf1193c792153c139800c92c37a555f9d1.zip
Doxygen-38fdb5cf1193c792153c139800c92c37a555f9d1.tar.gz
Doxygen-38fdb5cf1193c792153c139800c92c37a555f9d1.tar.bz2
Refactoring: replace QCString with std::string in constexp
Diffstat (limited to 'src/cppvalue.cpp')
-rw-r--r--src/cppvalue.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/cppvalue.cpp b/src/cppvalue.cpp
index 1543498..31f0ab5 100644
--- a/src/cppvalue.cpp
+++ b/src/cppvalue.cpp
@@ -1,13 +1,10 @@
/******************************************************************************
*
- *
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -21,30 +18,30 @@
#include "cppvalue.h"
#include "constexp.h"
-CPPValue parseOctal(const QCString& token)
+CPPValue parseOctal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '7') val = val * 8 + *p - '0';
}
return CPPValue(val);
}
-CPPValue parseDecimal(const QCString& token)
+CPPValue parseDecimal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '9') val = val * 10 + *p - '0';
}
return CPPValue(val);
}
-CPPValue parseHexadecimal(const QCString& token)
+CPPValue parseHexadecimal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '9') val = val * 16 + *p - '0';
else if (*p >= 'a' && *p <= 'f') val = val * 16 + *p - 'a' + 10;
@@ -54,7 +51,7 @@ CPPValue parseHexadecimal(const QCString& token)
return CPPValue(val);
}
-CPPValue parseCharacter(const QCString& token) // does not work for '\n' and the alike
+CPPValue parseCharacter(const std::string& token) // does not work for '\n' and the alike
{
if (token[1]=='\\')
{
@@ -80,16 +77,16 @@ CPPValue parseCharacter(const QCString& token) // does not work for '\n' and the
case '6': // fall through
case '7': // fall through
return parseOctal(token);
- case 'x':
+ case 'x':
case 'X': return parseHexadecimal(token);
- default: printf("Invalid escape sequence %s found!\n",token.data());
- return CPPValue(0L);
+ default: printf("Invalid escape sequence %s found!\n",token.data());
+ return CPPValue(0L);
}
}
return CPPValue((long)token[1]);
}
-CPPValue parseFloat(const QCString& token)
+CPPValue parseFloat(const std::string& token)
{
- return CPPValue(atof(token));
+ return CPPValue(std::stod(token));
}