rapidyaml  0.16.0
parseandemitYAML,anddoitfast
c4::yml::Location Struct Reference

holds a source or yaml file position, for example when an error is detected; See also location_format() and location_format_with_context(). More...

#include <common.hpp>

Public Member Functions

 operator bool () const noexcept
 
 Location () noexcept
 
 Location (size_t l) noexcept
 
 Location (size_t l, size_t c) noexcept
 
 Location (size_t b, size_t l, size_t c) noexcept
 
 Location (csubstr n, size_t l) noexcept
 
 Location (csubstr n, size_t l, size_t c) noexcept
 
 Location (csubstr n, size_t b, size_t l, size_t c) noexcept
 
 Location (const char *n, size_t l) noexcept
 
 Location (const char *n, size_t l, size_t c) noexcept
 
 Location (const char *n, size_t b, size_t l, size_t c) noexcept
 

Public Attributes

size_t offset
 number of bytes from the beginning of the source buffer More...
 
size_t line
 line More...
 
size_t col
 column More...
 
csubstr name
 name of the file More...
 

Detailed Description

holds a source or yaml file position, for example when an error is detected; See also location_format() and location_format_with_context().

Definition at line 228 of file common.hpp.

Constructor & Destructor Documentation

c4::yml::Location::Location ( )
inlinenoexcept

Definition at line 237 of file common.hpp.

237 : offset(npos), line(npos), col(npos), name() {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( size_t  l)
inlinenoexcept

Definition at line 238 of file common.hpp.

238 : offset(npos), line(l), col(npos), name() {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 239 of file common.hpp.

239 : offset(npos), line(l), col(c ), name() {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( size_t  b,
size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 240 of file common.hpp.

240 : offset(b ), line(l), col(c ), name() {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( csubstr  n,
size_t  l 
)
inlinenoexcept

Definition at line 241 of file common.hpp.

241 : offset(npos), line(l), col(npos), name(n) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( csubstr  n,
size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 242 of file common.hpp.

242 : offset(npos), line(l), col(c ), name(n) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( csubstr  n,
size_t  b,
size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 243 of file common.hpp.

243 : offset(b ), line(l), col(c ), name(n) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( const char *  n,
size_t  l 
)
inlinenoexcept

Definition at line 244 of file common.hpp.

244 : offset(npos), line(l), col(npos), name(to_csubstr(n)) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
csubstr to_csubstr(const char(&s)[N]) noexcept
Definition: substr.hpp:2380
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( const char *  n,
size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 245 of file common.hpp.

245 : offset(npos), line(l), col(c ), name(to_csubstr(n)) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
csubstr to_csubstr(const char(&s)[N]) noexcept
Definition: substr.hpp:2380
a null string position
Definition: common.hpp:138
size_t line
line
Definition: common.hpp:231
c4::yml::Location::Location ( const char *  n,
size_t  b,
size_t  l,
size_t  c 
)
inlinenoexcept

Definition at line 246 of file common.hpp.

246 : offset(b ), line(l), col(c ), name(to_csubstr(n)) {}
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
csubstr to_csubstr(const char(&s)[N]) noexcept
Definition: substr.hpp:2380
size_t line
line
Definition: common.hpp:231

Member Function Documentation

c4::yml::Location::operator bool ( ) const
inlinenoexcept

Definition at line 235 of file common.hpp.

235 { return !name.empty() || line != npos || offset != npos || col != npos; }
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:230
size_t col
column
Definition: common.hpp:232
csubstr name
name of the file
Definition: common.hpp:233
a null string position
Definition: common.hpp:138
bool empty() const noexcept
Definition: substr.hpp:356
size_t line
line
Definition: common.hpp:231

Member Data Documentation

size_t c4::yml::Location::offset

number of bytes from the beginning of the source buffer

Definition at line 230 of file common.hpp.

Referenced by c4::yml::location_format(), c4::yml::location_format_with_context(), sample_error_parse(), sample_location_tracking(), and c4::yml::ParserState::start_parse().

size_t c4::yml::Location::line

The documentation for this struct was generated from the following file: