19 #ifndef GEOS_DATAREPOSITORY_DATACONTEXT_HPP_
20 #define GEOS_DATAREPOSITORY_DATACONTEXT_HPP_
25 #include "common/Format.hpp"
29 namespace dataRepository
97 ToStringInfo(
string const & targetName,
string const & filePath,
size_t line );
153 {
return m_typeName; }
159 {
return m_filePath; }
172 {
return m_offsetInLine; }
184 string const m_typeName;
186 string const m_filePath;
190 size_t const m_offsetInLine;
192 size_t const m_offset;
197 ToStringInfo getToStringInfo()
const override;
212 struct GEOS_FMT_NS::formatter<
geos::dataRepository::DataContext > : GEOS_FMT_NS::formatter< std::string >
222 return GEOS_FMT_NS::formatter< std::string >::format( dataContext.
toString(), ctx );
string getTargetName() const
virtual ToStringInfo getToStringInfo() const =0
This method exposes the raw data of a DataContext, in order to access and format it (notably in toStr...
virtual string toString() const =0
DataContext(string const &targetName)
Construct a new DataContext object.
string const m_targetName
friend std::ostream & operator<<(std::ostream &os, const DataContext &ctx)
Insert contextual information in the provided stream.
virtual ~DataContext()
Destroy the DataContext object.
string getTypeName() const
string getFilePath() const
DataFileContext(xmlWrapper::xmlNode const &targetNode, xmlWrapper::xmlAttribute const &att, xmlWrapper::xmlAttributePos const &attPos)
Construct the file context of a Group from an xml node.
DataFileContext(xmlWrapper::xmlNode const &targetNode, xmlWrapper::xmlNodePos const &nodePos)
Construct the file context of a Group from an xml node.
string toString() const override
size_t getOffsetInLine() const
static constexpr size_t npos
Error value for when an offset / line position is undefined.
pugi::xml_attribute xmlAttribute
auto format(geos::dataRepository::DataContext const &dataContext, format_context &ctx)
Format the specified DataContext to a string.
ToStringInfo(string const &targetName, string const &filePath, size_t line)
Construct a new ToStringInfo object from a DataContext that has input file info.
size_t m_line
the file line of the DataFileContext, if it exists (an empty string otherwise)
ToStringInfo(string const &targetName)
Construct a new ToStringInfo object from a DataContext that has no input file info.
bool hasInputFileInfo() const
string m_filePath
the file path of the DataFileContext, if it exists (an empty string otherwise)
string m_targetName
the targetName of the DataContext