rapidyaml  0.7.0
parse and emit YAML, and do it fast
c4::yml::Location Struct Reference

a source file position More...

#include <common.hpp>

Public Member Functions

 operator bool () const
 
 operator LineCol const & () const
 
 Location ()=default
 
 Location (size_t l, size_t c)
 
 Location (size_t b, size_t l, size_t c)
 
 Location (csubstr n, size_t l, size_t c)
 
 Location (csubstr n, size_t b, size_t l, size_t c)
 
 Location (const char *n, size_t l, size_t c)
 
 Location (const char *n, size_t b, size_t l, size_t c)
 

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
 file name More...
 

Detailed Description

a source file position

Definition at line 295 of file common.hpp.

Constructor & Destructor Documentation

◆ Location() [1/7]

c4::yml::Location::Location ( )
default

◆ Location() [2/7]

c4::yml::Location::Location ( size_t  l,
size_t  c 
)
inline

Definition at line 310 of file common.hpp.

310 : offset( ), line(l), col(c), name( ) {}
size_t col
column
Definition: common.hpp:302
size_t line
line
Definition: common.hpp:300
size_t offset
number of bytes from the beginning of the source buffer
Definition: common.hpp:298
csubstr name
file name
Definition: common.hpp:304

◆ Location() [3/7]

c4::yml::Location::Location ( size_t  b,
size_t  l,
size_t  c 
)
inline

Definition at line 311 of file common.hpp.

311 : offset(b), line(l), col(c), name( ) {}

◆ Location() [4/7]

c4::yml::Location::Location ( csubstr  n,
size_t  l,
size_t  c 
)
inline

Definition at line 312 of file common.hpp.

312 : offset( ), line(l), col(c), name(n) {}

◆ Location() [5/7]

c4::yml::Location::Location ( csubstr  n,
size_t  b,
size_t  l,
size_t  c 
)
inline

Definition at line 313 of file common.hpp.

313 : offset(b), line(l), col(c), name(n) {}

◆ Location() [6/7]

c4::yml::Location::Location ( const char *  n,
size_t  l,
size_t  c 
)
inline

Definition at line 314 of file common.hpp.

314 : offset( ), line(l), col(c), name(to_csubstr(n)) {}
csubstr to_csubstr(substr s) noexcept
neutral version for use in generic code
Definition: substr.hpp:2189

◆ Location() [7/7]

c4::yml::Location::Location ( const char *  n,
size_t  b,
size_t  l,
size_t  c 
)
inline

Definition at line 315 of file common.hpp.

315 : offset(b), line(l), col(c), name(to_csubstr(n)) {}

Member Function Documentation

◆ operator bool()

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

Definition at line 306 of file common.hpp.

306 { return !name.empty() || line != 0 || offset != 0 || col != 0; }

◆ operator LineCol const &()

c4::yml::Location::operator LineCol const & ( ) const
inline

Definition at line 307 of file common.hpp.

307 { return reinterpret_cast<LineCol const&>(*this); }

Member Data Documentation

◆ offset

◆ line

◆ col

◆ name


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