• R/O
  • SSH
  • HTTPS

gtaconfig: Commit


Commit MetaInfo

Revision41 (tree)
Zeit2020-01-22 22:19:03
Autorquiret

Log Message

- fixed an issue where <string> was not included for std::stod
- replaced std::stoul with eir::to_number_len

Ändern Zusammenfassung

Diff

--- include/gtaconfig/syntax.h (revision 40)
+++ include/gtaconfig/syntax.h (revision 41)
@@ -6,6 +6,9 @@
66 #include <sdk/String.h> // for token to double/int.
77 #include <sdk/UniChar.h>
88
9+#include <string>
10+#include <sdk/NumericFormat.h>
11+
912 struct syntax_exception {};
1013 struct bad_format_exception {};
1114
@@ -17,7 +20,7 @@
1720 NUMERIC,
1821 SINGLE
1922 };
20-
23+
2124 enum class eCharacterClass
2225 {
2326 NAME,
@@ -554,17 +557,13 @@
554557
555558 static int TokenToInt(const encodingCharType *tok, size_t tokLen)
556559 {
557- //TODO: properly implement this, because pipelining through STL is fucking ugly.
558-
559560 eir::String <char, CRTHeapAllocator> tmpStr = CharacterUtil::ConvertStringsLength <encodingCharType, char, CRTHeapAllocator> ( tok, tokLen );
560561
561- std::basic_string <char> numStr( tmpStr.GetConstString(), tmpStr.GetLength() );
562-
563562 try
564563 {
565- return std::stoul( numStr );
564+ return eir::to_number_len( tok, tokLen );
566565 }
567- catch( std::invalid_argument& )
566+ catch( codepoint_exception& )
568567 {
569568 throw bad_format_exception();
570569 }
Show on old repository browser