mirror of
				https://github.com/open-source-parsers/jsoncpp.git
				synced 2025-11-04 02:32:19 -05:00 
			
		
		
		
	add all features
This commit is contained in:
		
							parent
							
								
									3cf9175bde
								
							
						
					
					
						commit
						f757c18ca0
					
				@ -298,12 +298,16 @@ public:
 | 
			
		||||
  /** Configuration of this builder.
 | 
			
		||||
    These are case-sensitive.
 | 
			
		||||
    Available settings (case-sensitive):
 | 
			
		||||
    - "collectComments": false or true (default=true)
 | 
			
		||||
    - TODO: other features ...
 | 
			
		||||
    - "collectComments": false or true
 | 
			
		||||
    - "allowComments"
 | 
			
		||||
    - "strictRoot"
 | 
			
		||||
    - "allowDroppedNullPlaceholders"
 | 
			
		||||
    - "allowNumericKeys"
 | 
			
		||||
 | 
			
		||||
    You can examine 'settings_` yourself
 | 
			
		||||
    to see the defaults. You can also write and read them just like any
 | 
			
		||||
    JSON Value.
 | 
			
		||||
    \sa setDefaults(Json::Value*)
 | 
			
		||||
    \sa setDefaults()
 | 
			
		||||
    */
 | 
			
		||||
  Json::Value settings_;
 | 
			
		||||
 | 
			
		||||
@ -312,7 +316,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  virtual CharReader* newCharReader() const;
 | 
			
		||||
 | 
			
		||||
  /** \return true if 'settings' are illegal and consistent;
 | 
			
		||||
  /** \return true if 'settings' are legal and consistent;
 | 
			
		||||
   *   otherwise, indicate bad settings via 'invalid'.
 | 
			
		||||
   */
 | 
			
		||||
  bool validate(Json::Value* invalid) const;
 | 
			
		||||
 | 
			
		||||
@ -99,11 +99,13 @@ public:
 | 
			
		||||
  // without a major version bump.
 | 
			
		||||
  /** Configuration of this builder.
 | 
			
		||||
    Available settings (case-sensitive):
 | 
			
		||||
    - "commentStyle": "None", "Some", or "All" (default="All")
 | 
			
		||||
    - "indentation":  (default="\t")
 | 
			
		||||
    But don't trust these docs. You can examine 'settings_` yourself
 | 
			
		||||
    - "commentStyle": "None", "Some", or "All"
 | 
			
		||||
    - "indentation":  "<anything>"
 | 
			
		||||
 | 
			
		||||
    You can examine 'settings_` yourself
 | 
			
		||||
    to see the defaults. You can also write and read them just like any
 | 
			
		||||
    JSON Value.
 | 
			
		||||
    \sa setDefaults()
 | 
			
		||||
    */
 | 
			
		||||
  Json::Value settings_;
 | 
			
		||||
 | 
			
		||||
@ -115,7 +117,7 @@ public:
 | 
			
		||||
   */
 | 
			
		||||
  virtual StreamWriter* newStreamWriter(std::ostream* sout) const;
 | 
			
		||||
 | 
			
		||||
  /** \return true if 'settings' are illegal and consistent;
 | 
			
		||||
  /** \return true if 'settings' are legal and consistent;
 | 
			
		||||
   *   otherwise, indicate bad settings via 'invalid'.
 | 
			
		||||
   */
 | 
			
		||||
  bool validate(Json::Value* invalid) const;
 | 
			
		||||
 | 
			
		||||
@ -925,13 +925,20 @@ CharReader* CharReaderBuilder::newCharReader() const
 | 
			
		||||
 | 
			
		||||
  bool collectComments = settings_["collectComments"].asBool();
 | 
			
		||||
  Features features = Features::all();
 | 
			
		||||
  // TODO: Fill in features.
 | 
			
		||||
  features.allowComments_ = settings_["allowComments"].asBool();
 | 
			
		||||
  features.strictRoot_ = settings_["strictRoot"].asBool();
 | 
			
		||||
  features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool();
 | 
			
		||||
  features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
 | 
			
		||||
  return new OldReader(collectComments, features);
 | 
			
		||||
}
 | 
			
		||||
static void getValidReaderKeys(std::set<std::string>* valid_keys)
 | 
			
		||||
{
 | 
			
		||||
  valid_keys->clear();
 | 
			
		||||
  valid_keys->insert("collectComments");
 | 
			
		||||
  valid_keys->insert("allowComments");
 | 
			
		||||
  valid_keys->insert("strictRoot");
 | 
			
		||||
  valid_keys->insert("allowDroppedNullPlaceholders");
 | 
			
		||||
  valid_keys->insert("allowNumericKeys");
 | 
			
		||||
}
 | 
			
		||||
bool CharReaderBuilder::validate(Json::Value* invalid) const
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user