20 #ifndef GEOS_DATAREPOSITORY_DATACONTEXT_HPP_
21 #define GEOS_DATAREPOSITORY_DATACONTEXT_HPP_
26 #include "common/format/Format.hpp"
31 namespace dataRepository
183 {
return m_typeName; }
189 {
return m_filePath; }
202 {
return m_offsetInLine; }
214 string const m_typeName;
216 string const m_filePath;
220 size_t const m_offsetInLine;
222 size_t const m_offset;
227 ToStringInfo getToStringInfo()
const override;
242 struct GEOS_FMT_NS::formatter<
geos::dataRepository::DataContext > : GEOS_FMT_NS::formatter< std::string >
252 return GEOS_FMT_NS::formatter< std::string >::format( dataContext.
toString(), ctx );
DataContext(string_view targetName)
Construct a new DataContext object.
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
virtual ErrorLogger::ErrorContext getContextInfo() const =0
Returns contextual information, including the file name and the line number.
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.
DataFileContext(string_view targetName, string_view file, size_t line)
Constructs the file context of a Group from a C++ source file.
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
ErrorLogger::ErrorContext getContextInfo() const override
Return contextual information (file and line of the input file where the error occured)
static constexpr size_t npos
Error value for when an offset / line position is undefined.
pugi::xml_attribute xmlAttribute
std::string_view string_view
String type.
auto format(geos::dataRepository::DataContext const &dataContext, format_context &ctx) const
Format the specified DataContext to a string.
size_t m_line
the file line of the DataFileContext, if it exists (an empty string otherwise)
bool hasInputFileInfo() const
ToStringInfo(string_view targetName, string_view filePath, size_t line)
Construct a new ToStringInfo object from a DataContext that has input file info.
ToStringInfo(string_view targetName)
Construct a new ToStringInfo object from a DataContext that has no input file info.
string m_filePath
the file path of the DataFileContext, if it exists (an empty string otherwise)
string m_targetName
the targetName of the DataContext