Consolix
Loading...
Searching...
No Matches
json_utils.hpp File Reference

Utilities for working with JSON strings, including removing comments. More...

#include <string>
#include <algorithm>

Go to the source code of this file.

Namespaces

namespace  consolix
 < Utility modules and helpers.
 

Macros

#define _CONSOLIX_JSON_UTILS_HPP_INCLUDED
 

Functions

bool consolix::check_escaped (const std::string &json_string, size_t quote_position)
 Checks if a character in a JSON string is escaped.
 
*The resulting JSON string may optionally retain whitespace or newlines *where the comments were removed **param json_string The JSON string to process *param with_whitespace If comments are replaced with equivalent whitespace *If comments are removed without leaving whitespace *param preserve_newlines If true and with_whitespace is newline characters *in comments are preserved all characters in the *comments are replaced with whitespace *return A JSON string with comments removed *std::string consolix::strip_json_comments (const std::string &json_string, bool with_whitespace=false, bool preserve_newlines=true)
 

Variables

*The resulting JSON string may optionally retain whitespace or newlines *where the comments were removed **param json_string The JSON string to process *param with_whitespace If consolix::true
 Removes comments from a JSON string.
 
*The resulting JSON string may optionally retain whitespace or newlines *where the comments were removed **param json_string The JSON string to process *param with_whitespace If comments are replaced with equivalent whitespace *If consolix::false
 
*The resulting JSON string may optionally retain whitespace or newlines *where the comments were removed **param json_string The JSON string to process *param with_whitespace If comments are replaced with equivalent whitespace *If comments are removed without leaving whitespace *param preserve_newlines If true and with_whitespace is consolix::enabled
 
*The resulting JSON string may optionally retain whitespace or newlines *where the comments were removed **param json_string The JSON string to process *param with_whitespace If comments are replaced with equivalent whitespace *If comments are removed without leaving whitespace *param preserve_newlines If true and with_whitespace is newline characters *in comments are preserved consolix::Otherwise
 

Detailed Description

Utilities for working with JSON strings, including removing comments.

Definition in file json_utils.hpp.

Macro Definition Documentation

◆ _CONSOLIX_JSON_UTILS_HPP_INCLUDED

#define _CONSOLIX_JSON_UTILS_HPP_INCLUDED

Definition at line 3 of file json_utils.hpp.