V-Gears 0
Free Final Fantasy VII engine.
FunctionMetaData Class Reference

Parses an stores function metadata. More...

#include <FieldCodeGenerator.h>

Public Member Functions

 FunctionMetaData (std::string meta_data)
 Constructor. More...
 
bool IsStart () const
 Checks if the function is the first of a class. More...
 
bool IsEnd () const
 Checks if the function is the last of a class. More...
 
std::string GetEntityName ()
 Retrieves the entity name. More...
 
int GetCharacterId ()
 Retrieves the character ID. More...
 

Private Member Functions

void Parse (std::string meta_data)
 Parses metadata. More...
 
void ParseStart (const std::string &item, std::deque< std::string > &strs)
 Parses a metadata item, looking for a start mark. More...
 
void ParseEnd (const std::string &item, std::deque< std::string > &strs)
 Parses a metadata item, looking for an end mark. More...
 
void ParseCharId (const std::string &item, std::deque< std::string > &strs)
 Parses a metadata item, looking for a character ID. More...
 
void ParseEntity (const std::string &item, std::deque< std::string > &strs)
 Parses a metadata item, looking for an entity name. More...
 

Private Attributes

bool end_ = false
 Indicates if the function is the last of a class. More...
 
bool start_ = false
 Indicates if the function is the first of a class. More...
 
std::string entity_name_
 The entity name. More...
 
int character_id_ = -1
 The character ID. More...
 

Static Private Attributes

static const std::string DELIMITER
 Delimiter for metadata tokens. More...
 
static const std::string START
 Start tag for metadata. More...
 
static const std::string END
 End tag for metadata. More...
 

Detailed Description

Parses an stores function metadata.

Function metadata can indicate the entity and character of a function, and if the function is the first or last in a class.

Constructor & Destructor Documentation

◆ FunctionMetaData()

FunctionMetaData::FunctionMetaData ( std::string  meta_data)

Constructor.

Parses function metadata.

Meta data format can be:

  • start_end_entityname
  • start_entityname
  • end_entity_name
Parameters
[in]meta_dataMetadata to parse.

Member Function Documentation

◆ GetCharacterId()

int FunctionMetaData::GetCharacterId ( )

Retrieves the character ID.

Returns
The character ID.

◆ GetEntityName()

std::string FunctionMetaData::GetEntityName ( )

Retrieves the entity name.

Returns
The entity name.

◆ IsEnd()

bool FunctionMetaData::IsEnd ( ) const

Checks if the function is the last of a class.

Returns
True if the metadata is the last of a class, false otherwise.

◆ IsStart()

bool FunctionMetaData::IsStart ( ) const

Checks if the function is the first of a class.

Returns
True if the metadata is the first of a class, false otherwise.

◆ Parse()

void FunctionMetaData::Parse ( std::string  meta_data)
private

Parses metadata.

Parameters
[in]meta_dataMetadata to parse.

◆ ParseCharId()

void FunctionMetaData::ParseCharId ( const std::string &  item,
std::deque< std::string > &  strs 
)
private

Parses a metadata item, looking for a character ID.

If it finds it, sets the character ID. It also calls {

See also
ParseEntity}.
Parameters
[in]itemThe item to check for a start mark.
[in]strsMetadata tokens, first two removed.

◆ ParseEnd()

void FunctionMetaData::ParseEnd ( const std::string &  item,
std::deque< std::string > &  strs 
)
private

Parses a metadata item, looking for an end mark.

If it finds it, marks the metadata as the last function of a class. It also calls {

See also
ParseCharId}.
Parameters
[in]itemThe item to check for a start mark.
[in]strsMetadata tokens, first removed.

◆ ParseEntity()

void FunctionMetaData::ParseEntity ( const std::string &  item,
std::deque< std::string > &  strs 
)
private

Parses a metadata item, looking for an entity name.

It sets the entity name.

Parameters
[in]itemThe item to check for a start mark.
[in]strsMetadata tokens, first three removed.

◆ ParseStart()

void FunctionMetaData::ParseStart ( const std::string &  item,
std::deque< std::string > &  strs 
)
private

Parses a metadata item, looking for a start mark.

If it finds it, marks the metadata as the first function of a class. It also * calls {

See also
ParseEnd} with the next token.
Parameters
[in]itemThe item to check for a start mark.
[in]strsAll the metadata tokens.

Member Data Documentation

◆ character_id_

int FunctionMetaData::character_id_ = -1
private

The character ID.

◆ DELIMITER

const std::string FunctionMetaData::DELIMITER
staticprivate

Delimiter for metadata tokens.

◆ END

const std::string FunctionMetaData::END
staticprivate

End tag for metadata.

◆ end_

bool FunctionMetaData::end_ = false
private

Indicates if the function is the last of a class.

◆ entity_name_

std::string FunctionMetaData::entity_name_
private

The entity name.

◆ START

const std::string FunctionMetaData::START
staticprivate

Start tag for metadata.

◆ start_

bool FunctionMetaData::start_ = false
private

Indicates if the function is the first of a class.


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