- added Int/UInt typedef in Json namespace. Modified Value::Int and Value::UInt to be typedef on those. Modified code to use Json::Int instead of Value::Int.
- added Value constructor taking begin/end pointer to initialize the Value with a non-zero terminated string.
diff --git a/include/json/forwards.h b/include/json/forwards.h
index ee76071..d0ce830 100644
--- a/include/json/forwards.h
+++ b/include/json/forwards.h
@@ -5,14 +5,19 @@
namespace Json {
+ // writer.h
class FastWriter;
- class Reader;
class StyledWriter;
+ // reader.h
+ class Reader;
+
// features.h
class Features;
// value.h
+ typedef int Int;
+ typedef unsigned int UInt;
class StaticString;
class Path;
class PathArgument;
diff --git a/include/json/value.h b/include/json/value.h
index ce3d3cd..d575b70 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -117,10 +117,10 @@
# endif
public:
typedef std::vector<std::string> Members;
- typedef int Int;
- typedef unsigned int UInt;
typedef ValueIterator iterator;
typedef ValueConstIterator const_iterator;
+ typedef Json::UInt UInt;
+ typedef Json::Int Int;
typedef UInt ArrayIndex;
static const Value null;
@@ -186,6 +186,7 @@
Value( UInt value );
Value( double value );
Value( const char *value );
+ Value( const char *beginValue, const char *endValue );
/** \brief Constructs a value from a static string.
* Like other value string constructor but do not duplicate the string for
@@ -453,7 +454,7 @@
friend class Path;
PathArgument();
- PathArgument( Value::UInt index );
+ PathArgument( UInt index );
PathArgument( const char *key );
PathArgument( const std::string &key );
@@ -465,7 +466,7 @@
kindKey
};
std::string key_;
- Value::UInt index_;
+ UInt index_;
Kind kind_;
};
@@ -909,7 +910,7 @@
Value key() const;
/// Return the index of the referenced Value. -1 if it is not an arrayValue.
- Value::UInt index() const;
+ UInt index() const;
/// Return the member name of the referenced Value. "" if it is not an objectValue.
const char *memberName() const;
diff --git a/include/json/writer.h b/include/json/writer.h
index cfa92c6..5f4b83b 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -157,8 +157,8 @@
bool addChildValues_;
};
- std::string JSON_API valueToString( Value::Int value );
- std::string JSON_API valueToString( Value::UInt value );
+ std::string JSON_API valueToString( Int value );
+ std::string JSON_API valueToString( UInt value );
std::string JSON_API valueToString( double value );
std::string JSON_API valueToString( bool value );
std::string JSON_API valueToQuotedString( const char *value );