aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2019-06-13 12:25:25 -0700
committerMike Buland <mbuland@penny-arcade.com>2019-06-13 12:25:25 -0700
commit8ba8268b51081b3b7d34da8fcec14d58b53f6d47 (patch)
tree25dd6b2c13d4b5cc1f6088e5c3c8a7a356ade37c
parent889cf794108dc1a8c4d2c50fc864846799f512e1 (diff)
downloadlibbu++-8ba8268b51081b3b7d34da8fcec14d58b53f6d47.tar.gz
libbu++-8ba8268b51081b3b7d34da8fcec14d58b53f6d47.tar.bz2
libbu++-8ba8268b51081b3b7d34da8fcec14d58b53f6d47.tar.xz
libbu++-8ba8268b51081b3b7d34da8fcec14d58b53f6d47.zip
Added string comparison operator to json.
-rw-r--r--src/unstable/json.cpp8
-rw-r--r--src/unstable/json.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp
index 7e6387b..d3d8535 100644
--- a/src/unstable/json.cpp
+++ b/src/unstable/json.cpp
@@ -525,6 +525,14 @@ Bu::Json &Bu::Json::operator=( const Bu::Json &rSrc )
525 return *this; 525 return *this;
526} 526}
527 527
528bool Bu::Json::operator==( const Bu::String &rRhs )
529{
530 if( eType != String )
531 return false;
532
533 return (*uDat.pString) == rRhs;
534}
535
528void Bu::Json::parseString( Bu::UtfChar &c, Bu::Stream &sInput, 536void Bu::Json::parseString( Bu::UtfChar &c, Bu::Stream &sInput,
529 Bu::UtfString &sOut ) 537 Bu::UtfString &sOut )
530{ 538{
diff --git a/src/unstable/json.h b/src/unstable/json.h
index 100a3d1..5373bcf 100644
--- a/src/unstable/json.h
+++ b/src/unstable/json.h
@@ -87,6 +87,7 @@ namespace Bu
87 Bu::String toStringStable() const; 87 Bu::String toStringStable() const;
88 88
89 Bu::Json &operator=( const Bu::Json &rSrc ); 89 Bu::Json &operator=( const Bu::Json &rSrc );
90 bool operator==( const Bu::String &rRhs );
90 91
91 private: 92 private:
92 void parse( Bu::UtfChar &c, Bu::Stream &sInput ); 93 void parse( Bu::UtfChar &c, Bu::Stream &sInput );