Function operator<<

Summary

#include <include/cpptoml.h>

(1) std::ostream & operator<<(std::ostream &os, const local_date &dt)

(2) std::ostream & operator<<(std::ostream &os, const local_time &ltime)

(3) std::ostream & operator<<(std::ostream &os, const zone_offset &zo)

(4) std::ostream & operator<<(std::ostream &os, const local_datetime &dt)

(5) std::ostream & operator<<(std::ostream &os, const offset_datetime &dt)

(6) std::ostream & operator<<(std::ostream &stream, const base &b)

(7) template <class T>
    std::ostream & operator<<(std::ostream &stream, const value< T > &v)

(8) std::ostream & operator<<(std::ostream &stream, const table &t)

(9) std::ostream & operator<<(std::ostream &stream, const table_array &t)

(10) std::ostream & operator<<(std::ostream &stream, const array &a)

Function overload

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &os, const local_date &dt)

Description

No description yet.

Source

Lines 186-196 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& os, const local_date& dt)
{
    fill_guard g{os};
    os.fill('0');

    using std::setw;
    os << setw(4) << dt.year << "-" << setw(2) << dt.month << "-" << setw(2)
       << dt.day;

    return os;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &os, const local_time &ltime)

Description

No description yet.

Source

Lines 198-220 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& os, const local_time& ltime)
{
    fill_guard g{os};
    os.fill('0');

    using std::setw;
    os << setw(2) << ltime.hour << ":" << setw(2) << ltime.minute << ":"
       << setw(2) << ltime.second;

    if (ltime.microsecond > 0)
    {
        os << ".";
        int power = 100000;
        for (int curr_us = ltime.microsecond; curr_us; power /= 10)
        {
            auto num = curr_us / power;
            os << num;
            curr_us -= num * power;
        }
    }

    return os;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &os, const zone_offset &zo)

Description

No description yet.

Source

Lines 222-248 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& os, const zone_offset& zo)
{
    fill_guard g{os};
    os.fill('0');

    using std::setw;

    if (zo.hour_offset != 0 || zo.minute_offset != 0)
    {
        if (zo.hour_offset > 0)
        {
            os << "+";
        }
        else
        {
            os << "-";
        }
        os << setw(2) << std::abs(zo.hour_offset) << ":" << setw(2)
           << std::abs(zo.minute_offset);
    }
    else
    {
        os << "Z";
    }

    return os;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &os, const local_datetime &dt)

Description

No description yet.

Source

Lines 250-254 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& os, const local_datetime& dt)
{
    return os << static_cast<const local_date&>(dt) << "T"
              << static_cast<const local_time&>(dt);
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &os, const offset_datetime &dt)

Description

No description yet.

Source

Lines 256-260 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& os, const offset_datetime& dt)
{
    return os << static_cast<const local_datetime&>(dt)
              << static_cast<const zone_offset&>(dt);
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &stream, const base &b)

Description

No description yet.

Source

Lines 3632-3637 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& stream, const base& b)
{
    toml_writer writer{stream};
    b.accept(writer);
    return stream;
}

Synopsis

#include <include/cpptoml.h>

template <class T>
std::ostream & operator<<(std::ostream &stream, const value< T > &v)

Description

No description yet.

Source

Lines 3639-3645 in include/cpptoml.h.

template <class T>
std::ostream& operator<<(std::ostream& stream, const value<T>& v)
{
    toml_writer writer{stream};
    v.accept(writer);
    return stream;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &stream, const table &t)

Description

No description yet.

Source

Lines 3647-3652 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& stream, const table& t)
{
    toml_writer writer{stream};
    t.accept(writer);
    return stream;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &stream, const table_array &t)

Description

No description yet.

Source

Lines 3654-3659 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& stream, const table_array& t)
{
    toml_writer writer{stream};
    t.accept(writer);
    return stream;
}

Synopsis

#include <include/cpptoml.h>

std::ostream & operator<<(std::ostream &stream, const array &a)

Description

No description yet.

Source

Lines 3661-3666 in include/cpptoml.h.

inline std::ostream& operator<<(std::ostream& stream, const array& a)
{
    toml_writer writer{stream};
    a.accept(writer);
    return stream;
}





Add Discussion as Guest

Log in