fson  1.0.2
A comment-preserving C++ library for FSON — a human-friendly superset of JSON / JSON5
fedem::fson::String Class Referencefinal

#include <String.hh>

+ Inheritance diagram for fedem::fson::String:
+ Collaboration diagram for fedem::fson::String:

Public Types

enum class  Form { Quoted , Multiline }
 
- Public Types inherited from fedem::fson::Value
enum class  Type {
  Null , Boolean , Number , String ,
  Array , Object
}
 

Public Member Functions

 String (std::string value=std::string(), Form form=Form::Quoted)
 
Type getType () const noexcept override
 
std::unique_ptr< Valueclone () const override
 
StringasString () noexcept override
 
String const * asString () const noexcept override
 
std::string const & getValue () const noexcept
 
void setValue (std::string value)
 
Form getForm () const noexcept
 
void setForm (Form form) noexcept
 
- Public Member Functions inherited from fedem::fson::Value
virtual ~Value ()
 
bool isNull () const noexcept
 
bool isBoolean () const noexcept
 
bool isNumber () const noexcept
 
bool isString () const noexcept
 
bool isArray () const noexcept
 
bool isObject () const noexcept
 
virtual NullasNull () noexcept
 
virtual Null const * asNull () const noexcept
 
virtual BooleanasBoolean () noexcept
 
virtual Boolean const * asBoolean () const noexcept
 
virtual NumberasNumber () noexcept
 
virtual Number const * asNumber () const noexcept
 
virtual ArrayasArray () noexcept
 
virtual Array const * asArray () const noexcept
 
virtual ObjectasObject () noexcept
 
virtual Object const * asObject () const noexcept
 

Private Attributes

std::string value
 
Form form
 

Additional Inherited Members

- Protected Member Functions inherited from fedem::fson::Value
 Value ()=default
 

Member Enumeration Documentation

◆ Form

Enumerator
Quoted 
Multiline 

Constructor & Destructor Documentation

◆ String()

fedem::fson::String::String ( std::string  value = std::string( ),
Form  form = Form::Quoted 
)
inlineexplicit

Member Function Documentation

◆ getType()

Value::Type fedem::fson::String::getType ( ) const
inlineoverridevirtualnoexcept

◆ clone()

std::unique_ptr< Value > fedem::fson::String::clone ( ) const
inlineoverridevirtual

Implements fedem::fson::Value.

References form, and value.

◆ asString() [1/2]

String * fedem::fson::String::asString ( )
inlineoverridevirtualnoexcept

Reimplemented from fedem::fson::Value.

◆ asString() [2/2]

String const * fedem::fson::String::asString ( ) const
inlineoverridevirtualnoexcept

Reimplemented from fedem::fson::Value.

◆ getValue()

std::string const & fedem::fson::String::getValue ( ) const
inlinenoexcept

References value.

Referenced by fedem::fson::Object::getString().

+ Here is the caller graph for this function:

◆ setValue()

void fedem::fson::String::setValue ( std::string  value)
inline

References value.

◆ getForm()

String::Form fedem::fson::String::getForm ( ) const
inlinenoexcept

References form.

Referenced by fedem::fson::FsonParser::parseArrayBody(), and fedem::fson::FsonParser::parseObjectBody().

+ Here is the caller graph for this function:

◆ setForm()

void fedem::fson::String::setForm ( Form  form)
inlinenoexcept

References form.

Member Data Documentation

◆ value

std::string fedem::fson::String::value
private

Referenced by clone(), getValue(), and setValue().

◆ form

Form fedem::fson::String::form
private

Referenced by clone(), getForm(), and setForm().


The documentation for this class was generated from the following file: