print overloads

Synopses

Declared in <bdlb_printmethods.h>

Format the specified object to the specified output stream.

std::ostream&
print(
    std::ostream& stream,
    char object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream.

std::ostream&
print(
    std::ostream& stream,
    unsigned char object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. As all objects of this type have the same value, object is ignored and a descriptive, human‐readable message is output for all objects of this type.

std::ostream&
print(
    std::ostream& stream,
    std::monostate const& object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.

template<class TYPE>
std::ostream&
print(
    std::ostream& stream,
    TYPE const& object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. A descriptive, human‐readable message, indented according to level and spacesPerLevel, is output for objects having no value (i.e., false == object.has_value()).

template<class TYPE>
std::ostream&
print(
    std::ostream& stream,
    std::optional<TYPE> const& object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. A descriptive, human‐readable message, indented according to level and spacesPerLevel, is output for objects holding the value of type std::monostate. Note that a std::variant object can hold the std::monostate value only if its template parameters explicitly mention the std::monostate type.

template<class... TYPE>
std::ostream&
print(
    std::ostream& stream,
    std::variant<TYPE...> const& object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. Note that output will be formatted on one line. Also note that non‐printable characters in object will be printed using their hexadecimal representation. If stream is not valid on entry, this operation has no effect.

template<class ALLOC>
std::ostream&
print(
    std::ostream& stream,
    bsl::vector<char, ALLOC> const& object,
    int level = 0,
    int spacesPerLevel = 4);

Format the specified object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. Note that output will be formatted on one line. If stream is not valid on entry, this operation has no effect.

template<
    class CHAR_T,
    class CHAR_TRAITS_T,
    class ALLOC>
std::ostream&
print(
    std::ostream& stream,
    bsl::basic_string<CHAR_T, CHAR_TRAITS_T, ALLOC> const& object,
    int level = 0,
    int spacesPerLevel = 4);

Created with MrDocs