Struct Location

Synopsis

#include <src/c4/yml/common.hpp>

struct RYML_EXPORT Location : public LineCol

Description

a source file position

Inheritance

Ancestors: LineCol

Summary

operator bool
Location overload

Source

Lines 84-96 in src/c4/yml/common.hpp.

struct RYML_EXPORT Location : public LineCol
{
    csubstr name;

    operator bool () const { return !name.empty() || line != 0 || offset != 0; }

    Location() : LineCol(), name() {}
    Location(                         size_t l, size_t c) : LineCol{   l, c}, name( ) {}
    Location(    csubstr n,           size_t l, size_t c) : LineCol{   l, c}, name(n) {}
    Location(    csubstr n, size_t b, size_t l, size_t c) : LineCol{b, l, c}, name(n) {}
    Location(const char *n,           size_t l, size_t c) : LineCol{   l, c}, name(to_csubstr(n)) {}
    Location(const char *n, size_t b, size_t l, size_t c) : LineCol{b, l, c}, name(to_csubstr(n)) {}
};





Add Discussion as Guest

Log in