Fixing warnings. Added JSONCPP_DEPRECATED definition for clang. Also updating .gitignore to ignore .DS_Store files (Mac OS Finder generated)
diff --git a/include/json/config.h b/include/json/config.h
index b2bfb29..c83e78a 100644
--- a/include/json/config.h
+++ b/include/json/config.h
@@ -120,6 +120,9 @@
#endif
#ifdef __clang__
+# if __has_extension(attribute_deprecated_with_message)
+# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
+# endif
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
diff --git a/include/json/reader.h b/include/json/reader.h
index 5ee962a..82859fd 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -32,7 +32,7 @@
*
* \deprecated Use CharReader and CharReaderBuilder.
*/
-class JSON_API Reader {
+class JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") JSON_API Reader {
public:
typedef char Char;
typedef const Char* Location;
@@ -230,6 +230,9 @@
void addComment(Location begin, Location end, CommentPlacement placement);
void skipCommentTokens(Token& token);
+ static bool containsNewLine(Location begin, Location end);
+ static JSONCPP_STRING normalizeEOL(Location begin, Location end);
+
typedef std::stack<Value*> Nodes;
Nodes nodes_;
Errors errors_;
diff --git a/include/json/value.h b/include/json/value.h
index 2da9559..ebca175 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -518,10 +518,12 @@
/// \pre type() is objectValue or nullValue
/// \post type() is unchanged
/// \deprecated
+ JSONCPP_DEPRECATED("")
Value removeMember(const char* key);
/// Same as removeMember(const char*)
/// \param key may contain embedded nulls.
/// \deprecated
+ JSONCPP_DEPRECATED("")
Value removeMember(const JSONCPP_STRING& key);
/// Same as removeMember(const char* begin, const char* end, Value* removed),
/// but 'key' is null-terminated.
diff --git a/include/json/writer.h b/include/json/writer.h
index 8a1279b..f258cbf 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -140,7 +140,7 @@
/** \brief Abstract class for writers.
* \deprecated Use StreamWriter. (And really, this is an implementation detail.)
*/
-class JSON_API Writer {
+class JSONCPP_DEPRECATED("Use StreamWriter instead") JSON_API Writer {
public:
virtual ~Writer();
@@ -156,7 +156,7 @@
* \sa Reader, Value
* \deprecated Use StreamWriterBuilder.
*/
-class JSON_API FastWriter : public Writer {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter : public Writer {
public:
FastWriter();
@@ -209,7 +209,7 @@
* \sa Reader, Value, Value::setComment()
* \deprecated Use StreamWriterBuilder.
*/
-class JSON_API StyledWriter : public Writer {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledWriter : public Writer {
public:
StyledWriter();
~StyledWriter() JSONCPP_OVERRIDE {}
@@ -267,12 +267,14 @@
* If the Value have comments then they are outputed according to their
#CommentPlacement.
*
- * \param indentation Each level will be indented by this amount extra.
* \sa Reader, Value, Value::setComment()
* \deprecated Use StreamWriterBuilder.
*/
-class JSON_API StyledStreamWriter {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledStreamWriter {
public:
+/**
+ * \param indentation Each level will be indented by this amount extra.
+ */
StyledStreamWriter(JSONCPP_STRING indentation = "\t");
~StyledStreamWriter() {}