#include <include/EDoc/Location.h>
Inheritance diagram for EDoc::Location:
The location is represented using a file and a line number. Quite often this information is not available and in those situations the instance will contain an "empt" location, where the file is eithre NULL or pointing to file type "", or the line number is 0
Definition at line 46 of file Location.h.
Public Member Functions | |
Location (Dictionary *dict_in=NULL) | |
See CodeBlock::CodeBlock(Dictionary* dict_in=NULL). | |
Location (const Location &right) | |
See CodeBlock::CodeBlock(const CodeBlock& right). | |
Location (const Location &right, Dictionary &dict_in) | |
See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in). | |
Location & | operator= (const Location &right) |
See CodeBlock::operator=(). | |
void | Read (PersistenceIFace &file, IndexedDictionary &idict) |
See CodeBlock::Read(). | |
void | Write (PersistenceIFace &file) const |
See CodeBlock::Write(). | |
void | Merge (const Location &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(). | |
bool | operator== (const Location &right) const |
Equivilance operator (Works across dictionaries). | |
bool | operator< (const Location &right) const |
Less than comparison so this can be used for std::map keys. | |
operator safe_bool_t () const | |
Returns true if location is non-empty through the boolean evaluation operator. | |
std::ostream & | SingleLinePrint (std::ostream &out) const |
Prints to given stream in single line format which is filename:line. | |
std::string | GetNormalisedName () const |
Returns a string for this locatrion in single line format which is filename:line. | |
std::string | ToString (std::string prefix="") const |
Returns a string representing the current object in a user readable manner. | |
Data Fields | |
File * | file |
A reference to the file object identifying the source file. | |
uint32_t | line |
The line within the given source file. | |
Protected Attributes | |
Dictionary & | dict |
A reference to the dictionary this object belongs to. | |
Private Types | |
typedef void(Location::*) | safe_bool_t () const |
Private Member Functions | |
void | this_type_does_not_support_comparison () const |
(BRIEF DESC NOT PROVIDED). |
typedef void(Location::*) EDoc::Location::safe_bool_t() const [private] |
Definition at line 48 of file Location.h.
EDoc::Location::Location | ( | EDoc::Dictionary * | dict_in = NULL |
) |
See CodeBlock::CodeBlock(Dictionary* dict_in=NULL).
Definition at line 36 of file Location.cpp.
References EDoc::DictionarySpecific::dict, file, and EDoc::Dictionary::files.
EDoc::Location::Location | ( | const Location & | right | ) |
See CodeBlock::CodeBlock(const CodeBlock& right).
Definition at line 44 of file Location.cpp.
EDoc::Location::Location | ( | const Location & | right, | |
EDoc::Dictionary & | dict_in | |||
) |
See CodeBlock::CodeBlock(const CodeBlock& right, Dictionary& dict_in).
Definition at line 51 of file Location.cpp.
References EDoc::DictionarySpecific::dict, file, and EDoc::Dictionary::files.
EDoc::Location::this_type_does_not_support_comparison | ( | ) | const [inline, private] |
(BRIEF DESC NOT PROVIDED).
Definition at line 49 of file Location.h.
Referenced by operator safe_bool_t().
EDoc::Location::operator= | ( | const Location & | right | ) |
Definition at line 62 of file Location.cpp.
References EDoc::DictionarySpecific::dict, file, EDoc::Dictionary::files, and line.
EDoc::Location::Read | ( | EDoc::PersistenceIFace & | file, | |
EDoc::IndexedDictionary & | idict | |||
) |
See CodeBlock::Read().
EDoc::EOFException |
| |
EDoc::FileIOException |
|
Definition at line 79 of file Location.cpp.
References file, EDoc::IndexedDictionary::files, KEY_SOURCE_FILE_NAME, KEY_SOURCE_LINE_NUMBER, and line.
Referenced by EDoc::TypeLoc::Read(), EDoc::Type::Read(), EDoc::FunctionTypeLoc::Read(), EDoc::FunctionLoc::Read(), and EDoc::Function::Read().
EDoc::Location::Write | ( | EDoc::PersistenceIFace & | file | ) | const |
See CodeBlock::Write().
EDoc::FileIOException |
|
Definition at line 86 of file Location.cpp.
References file, KEY_SOURCE_FILE_NAME, KEY_SOURCE_LINE_NUMBER, and line.
Referenced by EDoc::TypeLoc::Write(), EDoc::Type::Write(), EDoc::FunctionTypeLoc::Write(), EDoc::FunctionLoc::Write(), and EDoc::Function::Write().
EDoc::Location::Merge | ( | const Location & | right | ) |
See StringIdentifiedObject::Merge().
EDoc::MergeException |
|
Definition at line 99 of file Location.cpp.
References EDoc::DictionarySpecific::dict, EDOC_MERGE_ERROR, file, EDoc::Dictionary::files, EDoc::StringIdentifiedObject::GetKeyName(), and line.
Referenced by EDoc::Type::Merge().
EDoc::Location::ReplaceReferences | ( | EDoc::PStack & | stack, | |
void * | remove, | |||
void * | replace | |||
) | [virtual] |
See DictionarySpecific::ReplaceReferences().
Implements EDoc::DictionarySpecific.
Definition at line 147 of file Location.cpp.
References EDOC_REPLACE, file, and EDoc::PStack::Push().
Referenced by EDoc::TypeLoc::ReplaceReferences(), EDoc::Type::ReplaceReferences(), EDoc::FunctionTypeLoc::ReplaceReferences(), EDoc::FunctionLoc::ReplaceReferences(), and EDoc::Function::ReplaceReferences().
EDoc::Location::Print | ( | std::ostream & | out, | |
std::string | prefix = "" | |||
) | const [virtual] |
See DictionarySpecific::Print().
Implements EDoc::DictionarySpecific.
Definition at line 130 of file Location.cpp.
References file, EDoc::File::GetName(), and line.
Referenced by EDoc::TypeLoc::Print(), EDoc::Type::Print(), EDoc::FunctionTypeLoc::Print(), EDoc::FunctionLoc::Print(), EDoc::Function::Print(), and EDoc::Exception::Print().
EDoc::Location::Validate | ( | EDoc::PStack & | stack, | |
const Dictionary & | dict_in | |||
) | const [virtual] |
See DictionarySpecific::Validate().
Implements EDoc::DictionarySpecific.
Definition at line 161 of file Location.cpp.
References EDoc::DictionarySpecific::dict, EDOC_ASSERT, file, and EDoc::File::Validate().
Referenced by EDoc::TypeLoc::Validate(), EDoc::Type::Validate(), EDoc::FunctionTypeLoc::Validate(), EDoc::FunctionLoc::Validate(), and EDoc::Function::Validate().
EDoc::Location::operator== | ( | const Location & | right | ) | const |
Equivilance operator (Works across dictionaries).
Definition at line 124 of file Location.cpp.
References file, EDoc::File::GetName(), and line.
EDoc::Location::operator< | ( | const Location & | right | ) | const |
Less than comparison so this can be used for std::map keys.
Compares File first then line.
Definition at line 173 of file Location.cpp.
References file, EDoc::File::GetName(), and line.
EDoc::Location::operator safe_bool_t | ( | ) | const [inline] |
Returns true if location is non-empty through the boolean evaluation operator.
Uses the safe bool pattern which makes use of a member function pointer type for the boolean operation.
Definition at line 127 of file Location.h.
References file, EDoc::File::GetName(), line, and this_type_does_not_support_comparison().
EDoc::Location::SingleLinePrint | ( | std::ostream & | out | ) | const |
Prints to given stream in single line format which is filename:line.
Definition at line 137 of file Location.cpp.
References file, EDoc::File::GetName(), and line.
EDoc::Location::GetNormalisedName | ( | ) | const [inline] |
Returns a string for this locatrion in single line format which is filename:line.
Definition at line 145 of file Location.h.
References file, EDoc::File::GetName(), and line.
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().
A reference to the file object identifying the source file.
Definition at line 156 of file Location.h.
Referenced by GetNormalisedName(), Location(), Merge(), EDoc::Function::Merge(), operator safe_bool_t(), operator<(), operator=(), operator==(), Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessTryBlock(), Read(), ReplaceReferences(), SingleLinePrint(), Validate(), and Write().
uint32_t EDoc::Location::line |
The line within the given source file.
Definition at line 161 of file Location.h.
Referenced by EDoc::Type::GetNameInternal(), GetNormalisedName(), Merge(), EDoc::Function::Merge(), operator safe_bool_t(), operator<(), operator=(), operator==(), Print(), EDoc::Dictionary::ProcessCodeBlock(), EDoc::Dictionary::ProcessTryBlock(), Read(), SingleLinePrint(), and Write().
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(), Location(), EDoc::ManagedObject::ManagedObject(), EDoc::Type::Merge(), Merge(), EDoc::Function::Merge(), EDoc::SpecificManagedObject< EDoc::Type >::New(), EDoc::TypeLoc::operator=(), EDoc::Type::operator=(), EDoc::TryBlock::operator=(), EDoc::PropogatingException::operator=(), 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(), Validate(), EDoc::FunctionTypeLoc::Validate(), EDoc::FunctionType::Validate(), EDoc::FunctionLoc::Validate(), EDoc::Function::Validate(), EDoc::File::Validate(), EDoc::Exception::Validate(), EDoc::CodeBlock::Validate(), EDoc::CatchBlock::Validate(), EDoc::Type::Write(), and EDoc::Function::Write().