#include <include/EDoc/File.h>
Inheritance diagram for EDoc::File:
This is the simplest of the StringIdentifiedObject implementations. It represents a source file used in compilation and as its data only contains a string with that files name. This data type was created in order to reduce the size of the .edc files by storing a refrenced file for location objects etc as an integer index instead of the string with the full files name.
Definition at line 46 of file File.h.
Public Member Functions | |
File (Dictionary &dict_in, std::string key_name_in) | |
See StringIdentifiedObject::(Dictionary& dict_in, std::string key_name_in, bool populated_in=false). | |
File (Dictionary &dict_in, int32_t index_in) | |
See StringIdentifiedObject(Dictionary& dict_in, int32_t index_in, bool populated_in=false). | |
File & | operator= (const File &right) |
Copies data from another object into this one. | |
void | Read (PersistenceIFace &file, IndexedDictionary &idict) |
See StringIdentifiedObject::Read(). | |
void | Write (PersistenceIFace &file) const |
See StringIdentifiedObject::Write(). | |
virtual void | Merge (const StringIdentifiedObject &right) |
See StringIdentifiedObject::Merge(). | |
virtual size_t | ReplaceReferences (PStack &stack, void *remove, void *replace) |
See DictionarySpecific::ReplaceReferences(). | |
virtual std::ostream & | Print (std::ostream &out, std::string prefix="") const |
See DictionarySpecific::Print(). | |
virtual void | Validate (PStack &stack, const Dictionary &dict_in) const |
See DictionarySpecific::Validate(). | |
virtual uint8_t | GetRecordType () const |
See StringIdentifiedObject::GetRecordType(). | |
std::string | GetName () const |
Returns the file name for the source file this represents. | |
const std::string & | GetKeyName () const |
Returns the string key that identifies this object. | |
ssize_t | GetIndex () const |
Returns the integer key that identifies this object. | |
bool | IsPopulated () const |
Returns true if this object has been completely populated from a file source or manually or false if the object is incomplete. | |
std::string | ToString (std::string prefix="") const |
Returns a string representing the current object in a user readable manner. | |
Data Fields | |
std::string | name |
Name of source file this object represents. | |
Protected Member Functions | |
void | SetKeyName (std::string key_name_in) |
Used by derived class to set the string key once it is able to determine it. | |
Protected Attributes | |
bool | populated |
True if this object has been completely populated. | |
int32_t | index |
Set to the integer index used to identify this object or -1 if the key_name is used to identify this object. | |
std::string | key_name |
Set to the string key used to identify this object. | |
bool | writing |
USED ONLY FROM Dictionary::Write(). | |
Dictionary & | dict |
A reference to the dictionary this object belongs to. |
EDoc::File::File | ( | EDoc::Dictionary & | dict_in, | |
std::string | key_name_in | |||
) |
See StringIdentifiedObject::(Dictionary& dict_in, std::string key_name_in, bool populated_in=false).
EDoc::File::File | ( | EDoc::Dictionary & | dict_in, | |
int32_t | index_in | |||
) |
See StringIdentifiedObject(Dictionary& dict_in, int32_t index_in, bool populated_in=false).
EDoc::File::operator= | ( | const File & | right | ) |
Copies data from another object into this one.
This can be used across different dictionaries and will only copy object data but not identification information used in the StringIdentifiedObject such as the key name.
Definition at line 49 of file File.cpp.
References name.
EDoc::File::Read | ( | EDoc::PersistenceIFace & | file, | |
EDoc::IndexedDictionary & | idict | |||
) | [virtual] |
See StringIdentifiedObject::Read().
EDoc::EOFException |
| |
EDoc::FileIOException |
|
Implements EDoc::StringIdentifiedObject.
Definition at line 61 of file File.cpp.
References KEY_NAME, name, EDoc::StringIdentifiedObject::populated, EDoc::PersistenceIFace::ReadString(), and EDoc::StringIdentifiedObject::SetKeyName().
EDoc::File::Write | ( | EDoc::PersistenceIFace & | file | ) | const [virtual] |
See StringIdentifiedObject::Write().
EDoc::FileIOException |
|
Implements EDoc::StringIdentifiedObject.
Definition at line 68 of file File.cpp.
References KEY_NAME, name, and EDoc::PersistenceIFace::WriteString().
EDoc::File::Merge | ( | const StringIdentifiedObject & | right | ) | [virtual] |
See StringIdentifiedObject::Merge().
Merge will fail if the file names are not the same.
Implements EDoc::StringIdentifiedObject.
Definition at line 79 of file File.cpp.
References EDOC_MERGE_ERROR, name, and EDoc::StringIdentifiedObject::populated.
EDoc::File::ReplaceReferences | ( | EDoc::PStack & | stack, | |
void * | remove, | |||
void * | replace | |||
) | [virtual] |
See DictionarySpecific::ReplaceReferences().
Implements EDoc::DictionarySpecific.
EDoc::File::Print | ( | std::ostream & | out, | |
std::string | prefix = "" | |||
) | const [virtual] |
See DictionarySpecific::Print().
Implements EDoc::DictionarySpecific.
Definition at line 100 of file File.cpp.
References name.
EDoc::File::Validate | ( | EDoc::PStack & | stack, | |
const Dictionary & | dict_in | |||
) | const [virtual] |
See DictionarySpecific::Validate().
Implements EDoc::DictionarySpecific.
Definition at line 112 of file File.cpp.
References EDoc::DictionarySpecific::dict, EDOC_ASSERT, EDoc::Dictionary::files, EDoc::StringIdentifiedObject::GetKeyName(), EDoc::StringIdentifiedObject::index, and EDoc::StringIdentifiedObject::key_name.
Referenced by EDoc::Location::Validate().
EDoc::File::GetRecordType | ( | ) | const [virtual] |
See StringIdentifiedObject::GetRecordType().
Implements EDoc::StringIdentifiedObject.
Definition at line 34 of file File.cpp.
References VALUE_RECORD_TYPE_FILE.
EDoc::File::GetName | ( | ) | const [inline] |
Returns the file name for the source file this represents.
Definition at line 116 of file File.h.
References name.
Referenced by EDoc::Location::GetNormalisedName(), EDoc::Location::operator safe_bool_t(), EDoc::Location::operator<(), EDoc::Location::operator==(), EDoc::Location::Print(), and EDoc::Location::SingleLinePrint().
EDoc::StringIdentifiedObject::GetKeyName | ( | ) | const [inherited] |
Returns the string key that identifies this object.
Will assert if the object has not yet been populated OR it currently uses an integer identifier not a string identifier.
Definition at line 51 of file StringIdentifiedObject.cpp.
References EDOC_ASSERT, EDoc::StringIdentifiedObject::index, EDoc::StringIdentifiedObject::key_name, and EDoc::StringIdentifiedObject::writing.
Referenced by EDoc::ManagedObject::CAdd(), EDoc::ManagedObject::CAlwaysGet(), EDoc::ManagedObject::CRemove(), EDoc::Function::ExpandCallGraph(), EDoc::FunctionLoc::FunctionLoc(), EDoc::Type::GetBestName(), EDoc::Type::IsEquivilant(), EDoc::Type::Merge(), EDoc::Location::Merge(), EDoc::FunctionType::Merge(), EDoc::Function::Merge(), EDoc::FunctionLoc::operator<(), EDoc::TypeLoc::Print(), EDoc::PropogatingException::Print(), EDoc::FunctionTypeLoc::Print(), EDoc::FunctionLoc::Print(), EDoc::Function::Print(), EDoc::Exception::Print(), EDoc::CatchBlock::Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessFunction(), EDoc::StdErrFunctionProgress::Progress(), EDoc::Dictionary::Read(), EDoc::Dictionary::UpdateFunctionAddressLists(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), EDoc::Function::Validate(), Validate(), EDoc::Dictionary::Validate(), EDoc::CatchBlock::Validate(), and EDoc::Function::Write().
EDoc::StringIdentifiedObject::GetIndex | ( | ) | const [inline, inherited] |
Returns the integer key that identifies this object.
Definition at line 142 of file StringIdentifiedObject.h.
References EDoc::StringIdentifiedObject::index.
Referenced by EDoc::TypeLoc::Write(), EDoc::Type::Write(), EDoc::FunctionTypeLoc::Write(), EDoc::FunctionType::Write(), EDoc::FunctionLoc::Write(), and EDoc::Function::Write().
EDoc::StringIdentifiedObject::IsPopulated | ( | ) | const [inline, inherited] |
Returns true if this object has been completely populated from a file source or manually or false if the object is incomplete.
Definition at line 151 of file StringIdentifiedObject.h.
References EDoc::StringIdentifiedObject::populated.
Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::Type::GetBestName(), EDoc::FunctionType::GetSpecString(), EDoc::Function::GetSpecString(), and EDoc::Dictionary::Read().
EDoc::StringIdentifiedObject::SetKeyName | ( | std::string | key_name_in | ) | [protected, inherited] |
Used by derived class to set the string key once it is able to determine it.
Usually an instance is created with an integer index and then data is loaded into the object and once it has loaded it is able to determine what its string index should be. Then it will call this function which sets the integer index to -1 and sets the string key to the given value.
Definition at line 57 of file StringIdentifiedObject.cpp.
References EDOC_ASSERT, EDoc::StringIdentifiedObject::index, and EDoc::StringIdentifiedObject::key_name.
Referenced by EDoc::Type::Read(), EDoc::FunctionType::Read(), EDoc::Function::Read(), and Read().
EDoc::DictionarySpecific::ToString | ( | std::string | prefix = "" |
) | const [inherited] |
Returns a string representing the current object in a user readable manner.
This will return as a string exactly what Print() would display. This is primarily here for use from within python and for debugging.
Definition at line 34 of file DictionarySpecific.cpp.
References EDoc::DictionarySpecific::Print().
Referenced by EDoc::Dictionary::Read().
std::string EDoc::File::name |
bool EDoc::StringIdentifiedObject::populated [protected, inherited] |
True if this object has been completely populated.
Definition at line 176 of file StringIdentifiedObject.h.
Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::IsPopulated(), EDoc::Type::Merge(), EDoc::FunctionType::Merge(), EDoc::Function::Merge(), Merge(), EDoc::Type::operator=(), EDoc::FunctionType::operator=(), EDoc::Function::operator=(), EDoc::Type::Read(), EDoc::FunctionType::Read(), EDoc::Function::Read(), Read(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), and EDoc::Function::Validate().
int32_t EDoc::StringIdentifiedObject::index [mutable, protected, inherited] |
Set to the integer index used to identify this object or -1 if the key_name is used to identify this object.
Definition at line 182 of file StringIdentifiedObject.h.
Referenced by EDoc::IndexedObject::CAdd(), EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::GetIndex(), EDoc::StringIdentifiedObject::GetKeyName(), EDoc::StringIdentifiedObject::SetKeyName(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), EDoc::Function::Validate(), and Validate().
std::string EDoc::StringIdentifiedObject::key_name [protected, inherited] |
Set to the string key used to identify this object.
Definition at line 187 of file StringIdentifiedObject.h.
Referenced by EDoc::Dictionary::GeneratePredefined(), EDoc::StringIdentifiedObject::GetKeyName(), EDoc::StringIdentifiedObject::SetKeyName(), EDoc::Type::Validate(), EDoc::FunctionType::Validate(), EDoc::Function::Validate(), and Validate().
bool EDoc::StringIdentifiedObject::writing [mutable, protected, inherited] |
USED ONLY FROM Dictionary::Write().
While writing an object to file it is possible to use both the objects integer and string keys. This is the only time that is allowable and this flag is used to determine that.
Definition at line 204 of file StringIdentifiedObject.h.
Referenced by EDoc::StringIdentifiedObject::GetKeyName().
Dictionary& EDoc::DictionarySpecific::dict [protected, inherited] |
A reference to the dictionary this object belongs to.
Definition at line 150 of file DictionarySpecific.h.
Referenced by EDoc::ManagedObject::CAlwaysGet(), EDoc::CatchBlock::CatchBlock(), EDoc::Exception::Exception(), EDoc::Function::ExpandCallGraph(), EDoc::CodeBlock::ExpandCallGraph(), EDoc::FunctionLoc::FunctionLoc(), EDoc::FunctionTypeLoc::FunctionTypeLoc(), EDoc::Function::GetSubstException(), EDoc::Location::Location(), EDoc::ManagedObject::ManagedObject(), EDoc::Type::Merge(), EDoc::Location::Merge(), EDoc::Function::Merge(), EDoc::SpecificManagedObject< EDoc::Type >::New(), EDoc::TypeLoc::operator=(), EDoc::Type::operator=(), EDoc::TryBlock::operator=(), EDoc::PropogatingException::operator=(), EDoc::Location::operator=(), EDoc::FunctionTypeLoc::operator=(), EDoc::FunctionType::operator=(), EDoc::FunctionLoc::operator=(), EDoc::Function::operator=(), EDoc::Exception::operator=(), EDoc::CodeBlock::operator=(), EDoc::PropogatingException::PropogatingException(), EDoc::TryBlock::Read(), EDoc::Function::Read(), EDoc::CodeBlock::Read(), EDoc::TryBlock::TryBlock(), EDoc::TypeLoc::TypeLoc(), EDoc::TypeLoc::Validate(), EDoc::Type::Validate(), EDoc::TryBlock::Validate(), EDoc::PropogatingException::Validate(), EDoc::ManagedObject::Validate(), EDoc::Location::Validate(), EDoc::FunctionTypeLoc::Validate(), EDoc::FunctionType::Validate(), EDoc::FunctionLoc::Validate(), EDoc::Function::Validate(), Validate(), EDoc::Exception::Validate(), EDoc::CodeBlock::Validate(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and EDoc::Function::Write().