jhump commented on code in PR #3266:
URL: https://github.com/apache/avro/pull/3266#discussion_r1929244794


##########
lang/c++/include/avro/CustomAttributes.hh:
##########
@@ -19,27 +19,76 @@
 #ifndef avro_CustomAttributes_hh__
 #define avro_CustomAttributes_hh__
 
-#include "Config.hh"
 #include <iostream>
 #include <map>
 #include <optional>
 #include <string>
 
+#include "Config.hh"
+
 namespace avro {
 
 // CustomAttributes class stores avro custom attributes.
 // Each attribute is represented by a unique name and value.
 // User is supposed to create CustomAttributes object and then add it to 
Schema.
 class AVRO_DECL CustomAttributes {
+
 public:
-    // Retrieves the custom attribute json entity for that attributeName, 
returns an
-    // null if the attribute doesn't exist.
+    enum ValueMode {
+        // When a CustomAttributes is created using this mode, all values are 
strings.
+        // The value should not be quoted, but any interior quotes and special
+        // characters (such as newlines) must be escaped.
+        string,
+        // When a CustomAttributes is created using this mode, all values are 
JSON
+        // values. String values must be quoted and escaped.
+        json
+    };
+
+    // Creates a new CustomAttributes object where all values are strings.
+    // All values passed to addAttribute() and returned from getAttribute() or 
the
+    // attributes() map will not be enclosed in quotes. However, any internal 
quotes
+    // WILL be escaped and other special characters MAY be escaped.
+    //
+    // To support non-string values, use 
CustomAttributes(CustomAttributes::json) instead.
+    CustomAttributes() : CustomAttributes(string) {}

Review Comment:
   Deprecated these elements in 0f0efd2.
   
   I am testing using clang on OS X. I don't see any other deprecations in this 
C++ codebase, so I can't find any other examples of muting the compiler 
warnings that result from using the deprecated elements in the implementation 
and the tests. Let me know how I should handle this. For now, I've added 
clang-specific `#pragma` statements to eliminate the noisy warnings.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@avro.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to