![]() |
Rosetta
2018.31
|
#include <format.h>
Public Member Functions | |
virtual | ~BasicWriter () |
std::size_t | size () const |
const Char * | data () const FMT_NOEXCEPT |
const Char * | c_str () const |
std::basic_string< Char > | str () const |
void | write (BasicCStringRef< Char > format, ArgList args) |
BasicWriter & | operator<< (int value) |
BasicWriter & | operator<< (unsigned value) |
BasicWriter & | operator<< (long value) |
BasicWriter & | operator<< (unsigned long value) |
BasicWriter & | operator<< (LongLong value) |
BasicWriter & | operator<< (ULongLong value) |
BasicWriter & | operator<< (double value) |
BasicWriter & | operator<< (long double value) |
BasicWriter & | operator<< (char value) |
BasicWriter & | operator<< (typename internal::WCharHelper< wchar_t, Char >::Supported value) |
BasicWriter & | operator<< (fmt::BasicStringRef< Char > value) |
BasicWriter & | operator<< (typename internal::WCharHelper< StringRef, Char >::Supported value) |
template<typename T , typename Spec , typename FillChar > | |
BasicWriter & | operator<< (IntFormatSpec< T, Spec, FillChar > spec) |
template<typename StrChar > | |
BasicWriter & | operator<< (const StrFormatSpec< StrChar > &spec) |
void | clear () FMT_NOEXCEPT |
Buffer< Char > & | buffer () FMT_NOEXCEPT |
template<typename StrChar > | |
BasicWriter< Char >::CharPtr | write_str (const StrChar *s, std::size_t size, const AlignSpec &spec) |
template<typename Spec > | |
BasicWriter< Char >::CharPtr | prepare_int_buffer (unsigned num_digits, const Spec &spec, const char *prefix, unsigned prefix_size) |
Protected Member Functions | |
BasicWriter (Buffer< Char > &b) | |
Private Types | |
typedef internal::CharTraits < Char >::CharPtr | CharPtr |
Private Member Functions | |
FMT_DISALLOW_COPY_AND_ASSIGN (BasicWriter) | |
CharPtr | grow_buffer (std::size_t n) |
template<typename UInt > | |
Char * | write_unsigned_decimal (UInt value, unsigned prefix_size=0) |
template<typename Int > | |
void | write_decimal (Int value) |
CharPtr | prepare_int_buffer (unsigned num_digits, const EmptySpec &, const char *prefix, unsigned prefix_size) |
template<typename Spec > | |
CharPtr | prepare_int_buffer (unsigned num_digits, const Spec &spec, const char *prefix, unsigned prefix_size) |
template<typename T , typename Spec > | |
void | write_int (T value, Spec spec) |
template<typename T , typename Spec > | |
void | write_double (T value, const Spec &spec) |
template<typename StrChar > | |
CharPtr | write_str (const StrChar *s, std::size_t size, const AlignSpec &spec) |
template<typename StrChar , typename Spec > | |
void | write_str (const internal::Arg::StringValue< StrChar > &str, const Spec &spec) |
void | operator<< (typename internal::WCharHelper< wchar_t, Char >::Unsupported) |
void | operator<< (typename internal::WCharHelper< const wchar_t *, Char >::Unsupported) |
void | append_float_length (Char *&format_ptr, long double) |
template<typename T > | |
void | append_float_length (Char *&, T) |
Static Private Member Functions | |
static Char * | get (Char *p) |
static CharPtr | fill_padding (CharPtr buffer, unsigned total_size, std::size_t content_size, wchar_t fill) |
Private Attributes | |
Buffer< Char > & | buffer_ |
Friends | |
template<typename Impl , typename Char_ , typename Spec_ > | |
class | internal::ArgFormatterBase |
template<typename Impl , typename Char_ , typename Spec_ > | |
class | BasicPrintfArgFormatter |
This template provides operations for formatting and writing data into a character stream. The output is stored in a buffer provided by a subclass such as :class:fmt::BasicMemoryWriter
.
You can use one of the following typedefs for common character types:
+------—+-------------------—+ | Type | Definition | +=========+======================+ | Writer | BasicWriter<char> | +------—+-------------------—+ | WWriter | BasicWriter<wchar_t> | +------—+-------------------—+
|
private |
|
inlineexplicitprotected |
Constructs a BasicWriter
object.
|
inlinevirtual |
Destroys a BasicWriter
object.
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
Returns a pointer to the output buffer content with terminating null character appended.
References fmt::Buffer< T >::reserve(), amino_acids::size, and fmt::Buffer< T >::size().
|
inline |
References fmt::Buffer< T >::clear().
Referenced by pyrosetta.bindings.pose.ResidueLabelAccessor::discard().
|
inline |
Returns a pointer to the output buffer content. No terminating null character is appended.
Referenced by fmt::print().
|
staticprivate |
|
private |
|
inlinestaticprivate |
|
inlineprivate |
|
private |
|
private |
|
inline |
|
inline |
References value.
|
inline |
|
inline |
References value.
|
inline |
|
inline |
Formats value and writes it to the stream.
References value.
|
inline |
|
inline |
Formats value using the general format for floating-point numbers ('g'
) and writes it to the stream.
|
inline |
Writes a character to the stream.
References fmt::Buffer< T >::push_back().
|
inline |
References fmt::Buffer< T >::push_back().
|
inline |
Writes value to the stream.
References fmt::Buffer< T >::append(), and value.
|
inline |
References fmt::Buffer< T >::append().
|
inline |
References fmt::internal::convert().
|
inline |
References make_symmdef_file_denovo::length, and basic::options::OptionKeys::in::file::s.
|
inlineprivate |
References basic::options::OptionKeys::score::fiber_diffraction::p, and amino_acids::size.
|
private |
BasicWriter<Char>::CharPtr fmt::BasicWriter< Char >::prepare_int_buffer | ( | unsigned | num_digits, |
const Spec & | spec, | ||
const char * | prefix, | ||
unsigned | prefix_size | ||
) |
References fmt::ALIGN_CENTER, fmt::ALIGN_LEFT, fmt::ALIGN_NUMERIC, basic::options::OptionKeys::cutoutdomain::end, basic::options::OptionKeys::score::fiber_diffraction::p, fmt::Buffer< T >::reserve(), amino_acids::size, fmt::internal::to_unsigned(), and basic::options::OptionKeys::mp::visualize::width.
|
inline |
Returns the total number of characters written.
References fmt::Buffer< T >::size().
Referenced by fmt::print().
|
inline |
Returns the content of the output buffer as an std::string
.
Referenced by fmt::format(), and fmt::SystemError::init().
|
inline |
Writes formatted data.
args* is an argument list representing arbitrary arguments.
Example**::
MemoryWriter out; out.write("Current point:\n"); out.write("({:+f}, {:+f})", -3.14, 3.14);
This will write the following output to the out
object:
.. code-block:: none
Current point: (-3.140000, +3.140000)
The output can be accessed using :func:data()
, :func:c_str
or :func:str
methods.
See also :ref:syntax
.
References DRRAFTER::args, and fmt::format().
Referenced by fmt::format(), and fmt::print().
|
inlineprivate |
References fmt::internal::is_negative(), and value.
|
private |
References fmt::ALIGN_CENTER, fmt::ALIGN_DEFAULT, fmt::ALIGN_LEFT, fmt::ALIGN_RIGHT, fmt::Buffer< T >::capacity(), FMT_NULL, fmt::format(), fmt::HASH_FLAG, basic::options::OptionKeys::rna::denovo::offset, erraser_single_res_analysis::out, basic::options::OptionKeys::score::fiber_diffraction::p, fmt::PLUS_FLAG, fmt::internal::report_unknown_type(), fmt::Buffer< T >::reserve(), numeric::linear_algebra::sign(), fmt::SIGN_FLAG, fmt::Buffer< T >::size(), basic::options::OptionKeys::cutoutdomain::start, fmt::internal::to_unsigned(), DRRAFTER::type, utility::upper(), value, and basic::options::OptionKeys::mp::visualize::width.
|
private |
References fmt::CHAR_FLAG, fmt::internal::count_digits(), fmt::format_decimal(), fmt::HASH_FLAG, fmt::internal::is_negative(), basic::options::OptionKeys::score::fiber_diffraction::p, fmt::PLUS_FLAG, erraser_single_res_analysis::prefix, fmt::internal::report_unknown_type(), fmt::SIGN_FLAG, amino_acids::size, fmt::BasicStringRef< Char >::size(), fmt::internal::thousands_sep(), and value.
|
private |
|
private |
BasicWriter<Char>::CharPtr fmt::BasicWriter< Char >::write_str | ( | const StrChar * | s, |
std::size_t | size, | ||
const AlignSpec & | spec | ||
) |
|
inlineprivate |
References fmt::internal::count_digits(), and fmt::format_decimal().
|
friend |
|
friend |
|
private |