6
6
#include < string>
7
7
#include < cmath>
8
8
#include < algorithm>
9
- #include < format>
10
9
#include < fast_float/fast_float.h>
11
10
#include < spdlog/spdlog.h>
12
11
#include " IfcLoader.h"
@@ -294,13 +293,14 @@ namespace webifc::parsing {
294
293
295
294
bool IfcLoader::IsValidExpressID (const uint32_t expressID) const
296
295
{
297
- if (expressID == 0 || expressID > _maxExpressId || !_lines.contains (expressID)) return false ;
296
+ if (expressID == 0 || expressID > _maxExpressId ) return false ;
297
+ if (_lines.find (expressID) == _lines.end ()) return false ;
298
298
else return true ;
299
299
}
300
300
301
301
uint32_t IfcLoader::GetLineType (const uint32_t expressID) const
302
302
{
303
- if (expressID == 0 || expressID > _maxExpressId || ! _lines.contains (expressID)) {
303
+ if (expressID == 0 || expressID > _maxExpressId || _lines.find (expressID) == _lines. end ( )) {
304
304
spdlog::error (" [GetLineType()] Attempt to Access Invalid ExpressID {}" , expressID);
305
305
return 0 ;
306
306
}
@@ -318,7 +318,7 @@ namespace webifc::parsing {
318
318
319
319
void IfcLoader::MoveToLineArgument (const uint32_t expressID, const uint32_t argumentIndex) const
320
320
{
321
- if (! _lines.contains (expressID)) return ;
321
+ if (_lines.find (expressID) == _lines. end ( )) return ;
322
322
_tokenStream->MoveTo (_lines.at (expressID)->tapeOffset );
323
323
ArgumentOffset (argumentIndex);
324
324
}
@@ -343,7 +343,7 @@ namespace webifc::parsing {
343
343
344
344
void IfcLoader::PushDouble (double input)
345
345
{
346
- std::string numberString = std::format ( " {} " , input);
346
+ std::string numberString = std::to_string ( input);
347
347
size_t eLoc = numberString.find_first_of (' e' );
348
348
if (eLoc != std::string::npos) numberString[eLoc]=' E' ;
349
349
else if (std::floor (input) == input) numberString+=' .' ;
@@ -426,7 +426,7 @@ namespace webifc::parsing {
426
426
427
427
void IfcLoader::UpdateLineTape (const uint32_t expressID, const uint32_t type, const uint32_t start)
428
428
{
429
- if (! _lines.contains (expressID))
429
+ if (_lines.find (expressID) == _lines. end ( ))
430
430
{
431
431
// create line object
432
432
IfcLine * line = new IfcLine ();
@@ -656,7 +656,7 @@ namespace webifc::parsing {
656
656
uint32_t IfcLoader::GetNoLineArguments (uint32_t expressID) const
657
657
{
658
658
659
- if (! _lines.contains (expressID)) return 0 ;
659
+ if (_lines.find (expressID) == _lines. end ( )) return 0 ;
660
660
_tokenStream->MoveTo (_lines.at (expressID)->tapeOffset );
661
661
_tokenStream->Read <char >();
662
662
_tokenStream->Read <uint32_t >();
@@ -698,7 +698,7 @@ namespace webifc::parsing {
698
698
699
699
void IfcLoader::MoveToArgumentOffset (const uint32_t expressID, const uint32_t argumentIndex) const
700
700
{
701
- if (_lines.contains (expressID)) {
701
+ if (_lines.find (expressID) != _lines. end ( )) {
702
702
_tokenStream->MoveTo (_lines.at (expressID)->tapeOffset );
703
703
ArgumentOffset (argumentIndex);
704
704
}
@@ -733,7 +733,7 @@ namespace webifc::parsing {
733
733
734
734
uint32_t IfcLoader::GetNextExpressID (uint32_t expressId) const {
735
735
uint32_t currentId = expressId+1 ;
736
- while (! _lines.contains (currentId)) currentId++;
736
+ while (_lines.find (currentId) == _lines. end ( )) currentId++;
737
737
return currentId;
738
738
}
739
739
0 commit comments