helics  3.5.2
Public Member Functions | List of all members
helics::fileops::JsonMapBuilder Class Reference

#include <JsonBuilder.hpp>

Public Member Functions

 JsonMapBuilder (JsonMapBuilder &&map) noexcept=default
 
JsonMapBuilderoperator= (JsonMapBuilder &&map)=default
 
Json::Value & getJValue ()
 
bool isCompleted () const
 
bool isActive () const
 
bool addComponent (const std::string &info, int index) noexcept
 
int generatePlaceHolder (const std::string &location, int32_t code)
 
bool clearComponents (int32_t code)
 
bool clearComponents ()
 
std::string generate ()
 
void reset ()
 
void setCounterCode (int code)
 
int getCounterCode () const
 

Detailed Description

class handling the construction in pieces of a JSON map

Member Function Documentation

◆ addComponent()

bool helics::fileops::JsonMapBuilder::addComponent ( const std::string &  info,
int  index 
)
noexcept

add a component value for a previously generated location

Parameters
infothe string to use for information
indexthe index of the place holder
Returns
true if successfully added

◆ clearComponents() [1/2]

bool helics::fileops::JsonMapBuilder::clearComponents ( )

clear all remaining components return true if the builder can be generated

◆ clearComponents() [2/2]

bool helics::fileops::JsonMapBuilder::clearComponents ( int32_t  code)

clear components with a specific code return true if the map is now complete

◆ generate()

std::string helics::fileops::JsonMapBuilder::generate ( )

generate the JSON value

◆ generatePlaceHolder()

int helics::fileops::JsonMapBuilder::generatePlaceHolder ( const std::string &  location,
int32_t  code 
)

generate a new location to fill in later

Returns
the index value of the location for use in addComponent

◆ getJValue()

Json::Value & helics::fileops::JsonMapBuilder::getJValue ( )

get the underlying json object

◆ isCompleted()

bool helics::fileops::JsonMapBuilder::isCompleted ( ) const

check if the map has completed

◆ reset()

void helics::fileops::JsonMapBuilder::reset ( )

reset the builder

◆ setCounterCode()

void helics::fileops::JsonMapBuilder::setCounterCode ( int  code)
inline

set the counter code value


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