prefer ValueIterator::name() to ::memberName()
in case of embedded nulls
diff --git a/include/json/reader.h b/include/json/reader.h
index 251d7c6..728b35e 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -110,7 +110,7 @@
* during parsing.
* \deprecated Use getFormattedErrorMessages() instead (typo fix).
*/
- JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead")
+ JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
std::string getFormatedErrorMessages() const;
/** \brief Returns a user friendly string that list errors in the parsed
@@ -279,8 +279,6 @@
/** \brief Build a CharReader implementation.
- \deprecated This is experimental and will be altered before the next release.
-
Usage:
\code
using namespace Json;
diff --git a/include/json/value.h b/include/json/value.h
index 836b663..d91ccc4 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -667,16 +667,22 @@
/// Value.
Value key() const;
- /// Return the index of the referenced Value. -1 if it is not an arrayValue.
+ /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
UInt index() const;
+ /// Return the member name of the referenced Value, or "" if it is not an
+ /// objectValue.
+ /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
+ std::string name() const;
+
/// Return the member name of the referenced Value. "" if it is not an
/// objectValue.
/// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
+ JSONCPP_DEPRECATED("Use `key = name();` instead.")
char const* memberName() const;
/// Return the member name of the referenced Value, or NULL if it is not an
/// objectValue.
- /// Better version than memberName(). Allows embedded nulls.
+ /// \note Better version than memberName(). Allows embedded nulls.
char const* memberName(char const** end) const;
protected:
diff --git a/include/json/writer.h b/include/json/writer.h
index f6fcc9c..f5f0a38 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -132,7 +132,7 @@
};
/** \brief Abstract class for writers.
- * \deprecated Use StreamWriter.
+ * \deprecated Use StreamWriter. (And really, this is an implementation detail.)
*/
class JSON_API Writer {
public:
@@ -151,6 +151,7 @@
* \deprecated Use StreamWriterBuilder.
*/
class JSON_API FastWriter : public Writer {
+
public:
FastWriter();
virtual ~FastWriter() {}