HOPS
HOPS class reference
Public Member Functions | List of all members
hops::MHO_VexElementLineGenerator Class Reference

Class MHO_VexElementLineGenerator. More...

#include <MHO_VexElementLineGenerator.hh>

Public Member Functions

 MHO_VexElementLineGenerator ()
 
virtual ~MHO_VexElementLineGenerator ()
 
std::string ConstructElementLine (std::string element_name, mho_json &element, mho_json &format)
 Constructs a formatted line for an element in VEX format. More...
 
std::string GenerateCompound (std::string element_name, mho_json &element, mho_json &format)
 Generates a compound string from an element and format using specified types. More...
 
std::string GenerateEpoch (std::string element_name, mho_json &obj)
 Generates epoch string for given element name using provided JSON object. More...
 
std::string GenerateInt (std::string element_name, mho_json &obj)
 Generates a string representation of an integer value from a JSON object. More...
 
std::string GenerateKeyword (std::string element_name, mho_json &obj)
 Generates a keyword string from an element name and a JSON object. More...
 
std::string GenerateLink (std::string element_name, mho_json &obj)
 Generates a link string for an element using its name and associated JSON object. More...
 
std::string GenerateListInt (std::string element_name, mho_json &obj)
 Generates a string list of integers from a given JSON object. More...
 
std::string GenerateListReal (std::string element_name, mho_json &obj)
 Generates a formatted string from a JSON object containing real values. More...
 
std::string GenerateListString (std::string element_name, mho_json &obj)
 Generates a string list from a JSON object using given element name. More...
 
std::string GenerateRaDec (std::string element_name, mho_json &obj)
 Generates Right Ascension and Declination string for given element name from mho_json object. More...
 
std::string GenerateReal (std::string element_name, mho_json &obj)
 Generates a real value string from a JSON object with optional units. More...
 
std::string GenerateString (std::string element_name, mho_json &obj)
 Generates a string representation of an object's value with given element name. More...
 

Detailed Description

Class MHO_VexElementLineGenerator.

Constructs a formatted line for an data element in VEX format - needed to reconstruct VEX files from json representation.

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Fri Jun 17 10:45:26 2022 -0400

Constructor & Destructor Documentation

◆ MHO_VexElementLineGenerator()

hops::MHO_VexElementLineGenerator::MHO_VexElementLineGenerator ( )

◆ ~MHO_VexElementLineGenerator()

hops::MHO_VexElementLineGenerator::~MHO_VexElementLineGenerator ( )
virtual

Member Function Documentation

◆ ConstructElementLine()

std::string hops::MHO_VexElementLineGenerator::ConstructElementLine ( std::string  element_name,
mho_json element,
mho_json format 
)

Constructs a formatted line for an element in VEX format.

Parameters
element_nameName of the element as a string.
elementReference to the mho_json object containing element data.
formatReference to the mho_json object containing formatting rules.
Returns
Formatted line for the given element as a string.

◆ GenerateCompound()

std::string hops::MHO_VexElementLineGenerator::GenerateCompound ( std::string  element_name,
mho_json element,
mho_json format 
)

Generates a compound string from an element and format using specified types.

Parameters
element_nameInput element name as std::string
elementReference to input mho_json object containing element data
formatReference to input mho_json object containing format data
Returns
Generated compound string

◆ GenerateEpoch()

std::string hops::MHO_VexElementLineGenerator::GenerateEpoch ( std::string  element_name,
mho_json obj 
)

Generates epoch string for given element name using provided JSON object.

Parameters
element_nameName of the element to generate epoch for
objReference to a mho_json object containing element data
Returns
Generated epoch string as std::string

◆ GenerateInt()

std::string hops::MHO_VexElementLineGenerator::GenerateInt ( std::string  element_name,
mho_json obj 
)

Generates a string representation of an integer value from a JSON object.

Parameters
element_nameName of the element to retrieve as a string.
obj(mho_json&)
Returns
String containing the integer value and spaces.

◆ GenerateKeyword()

std::string hops::MHO_VexElementLineGenerator::GenerateKeyword ( std::string  element_name,
mho_json obj 
)

Generates a keyword string from an element name and a JSON object.

Parameters
element_nameInput element name as a string
objReference to a mho_json object containing the keyword value
Returns
Generated keyword string with appropriate spacing

◆ GenerateLink()

std::string hops::MHO_VexElementLineGenerator::GenerateLink ( std::string  element_name,
mho_json obj 
)

Generates a link string for an element using its name and associated JSON object.

Parameters
element_nameName of the element to generate a link for
obj(mho_json&)
Returns
Generated link string as std::string

◆ GenerateListInt()

std::string hops::MHO_VexElementLineGenerator::GenerateListInt ( std::string  element_name,
mho_json obj 
)

Generates a string list of integers from a given JSON object.

Parameters
element_nameName of the element to search for in the JSON object.
obj(mho_json&)
Returns
A string containing the list of integers separated by spaces, or an empty string if no matching elements are found.

◆ GenerateListReal()

std::string hops::MHO_VexElementLineGenerator::GenerateListReal ( std::string  element_name,
mho_json obj 
)

Generates a formatted string from a JSON object containing real values.

Parameters
element_nameName of the element to generate the list for.
obj(mho_json&)
Returns
Formatted string representing the list of real values with optional units.

◆ GenerateListString()

std::string hops::MHO_VexElementLineGenerator::GenerateListString ( std::string  element_name,
mho_json obj 
)

Generates a string list from a JSON object using given element name.

Parameters
element_nameName of the element to extract from the JSON object.
obj(mho_json&)
Returns
A string containing the extracted elements separated by space and delimited by ElementDelim().

◆ GenerateRaDec()

std::string hops::MHO_VexElementLineGenerator::GenerateRaDec ( std::string  element_name,
mho_json obj 
)

Generates Right Ascension and Declination string for given element name from mho_json object.

Parameters
element_nameName of the element to retrieve data from mho_json object
obj(mho_json&)
Returns
String containing Right Ascension and Declination values separated by space

◆ GenerateReal()

std::string hops::MHO_VexElementLineGenerator::GenerateReal ( std::string  element_name,
mho_json obj 
)

Generates a real value string from a JSON object with optional units.

Parameters
element_nameInput element name as std::string
objJSON object reference containing 'value' and optionally 'units'
Returns
Generated real value string

◆ GenerateString()

std::string hops::MHO_VexElementLineGenerator::GenerateString ( std::string  element_name,
mho_json obj 
)

Generates a string representation of an object's value with given element name.

Parameters
element_nameName of the element to generate string for.
obj(mho_json&)
Returns
Generated string representation of the object's value.

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