Base Framework
Public Member Functions | List of all members
ObjectModel::NiceFormat Class Reference

#include <base/objectmodel/ObjectModel.h>

Inherits StringOutputStream.

Public Member Functions

unsigned int getNiceFlags () const noexcept
 
void setNiceFlags (unsigned int flags) noexcept
 
unsigned int getIndent () const noexcept
 
void setIndent (unsigned int indent) noexcept
 
unsigned int getMaximumLineLength () const noexcept
 
void setMaximumLineLength (unsigned int maximumLineLength) noexcept
 
unsigned int enter () noexcept
 
void exit () noexcept
 
NiceFormatwriteIndent ()
 
NiceFormatwriteKeyword (const Literal &literal)
 
NiceFormatwriteTextUnquoted (const Literal &literal)
 
- Public Member Functions inherited from StringOutputStream
 StringOutputStream ()
 
 StringOutputStream (MemorySize capacity)
 
void ensureCapacity (MemorySize capacity)
 
void flush ()
 
const StringgetString () const
 
String toString ()
 
void restart ()
 
 operator const String & () const
 
 ~StringOutputStream ()
 
- Public Member Functions inherited from FormatOutputStream
 FormatOutputStream (OutputStream &out, unsigned int size=DEFAULT_BUFFER_SIZE)
 
 FormatOutputStream (const FormatOutputStream &copy)=delete
 
void reset () noexcept
 
bool isANSITerminal ()
 
FormatOutputStreamsetRadixPosition (unsigned int position) noexcept
 
FormatOutputStreamsetJustification (Symbols::Justification justification) noexcept
 
FormatOutputStreamsetWidth (unsigned int width) noexcept
 
FormatOutputStreamsetPrecision (unsigned int precision) noexcept
 
FormatOutputStreamsetDateFormat (const String &format)
 
void setLocale (const Locale &locale) noexcept
 
unsigned int getFlags () const noexcept
 
void setFlags (unsigned int flags) noexcept
 
Symbols::Base getBase () const noexcept
 
Symbols::Base getRealBase () const noexcept
 
unsigned int getWidth () const noexcept
 
unsigned int getPrecision () const noexcept
 
FormatOutputStreamoperator<< (Action action)
 
FormatOutputStreamoperator<< (Indent indent)
 
FormatOutputStreamoperator<< (TabIndent indent)
 
void indent (unsigned int size, bool useTab=false)
 
void addCharacterField (const char *buffer, MemorySize size)
 
void addCharacterField (const wchar *buffer, MemorySize size)
 
void addCharacterField (const char16_t *buffer, MemorySize size)
 
void addCharacterField (const char32_t *buffer, MemorySize size)
 
void addIntegerField (const char *buffer, MemorySize size, bool isSigned)
 
void addDateField (const Date &date)
 
void writeFloatingPointType (unsigned int significant, unsigned int *mantissa, unsigned int mantissaSize, int base2Exponent, unsigned int valueFlags)
 
FormatOutputStreamgetContext (Context &context) noexcept
 
FormatOutputStreamsetContext (const Context &context) noexcept
 
FormatOutputStreamoperator<< (const SourceCodeLocation &location)
 
template<MemorySize SIZE>
FormatOutputStreamoperator<< (const char(&literal)[SIZE])
 
FormatOutputStreamoperator<< (bool value)
 
FormatOutputStreamoperator<< (char value)
 
FormatOutputStreamoperator<< (wchar value)
 
FormatOutputStreamoperator<< (short int value)
 
FormatOutputStreamoperator<< (unsigned short int value)
 
FormatOutputStreamoperator<< (int value)
 
FormatOutputStreamoperator<< (unsigned int value)
 
FormatOutputStreamoperator<< (long value)
 
FormatOutputStreamoperator<< (unsigned long value)
 
FormatOutputStreamoperator<< (long long value)
 
FormatOutputStreamoperator<< (unsigned long long value)
 
FormatOutputStreamoperator<< (int128 value)
 
FormatOutputStreamoperator<< (uint128 value)
 
FormatOutputStreamoperator<< (float value)
 
FormatOutputStreamoperator<< (double value)
 
FormatOutputStreamoperator<< (long double value)
 
FormatOutputStreamoperator<< (float128 value)
 
FormatOutputStreamoperator<< (const NativeString &value)
 
FormatOutputStreamoperator<< (const NativeWideString &value)
 
FormatOutputStreamoperator<< (const char *value)
 
FormatOutputStreamoperator<< (const wchar *value)
 
FormatOutputStreamoperator<< (const char16_t *value)
 
FormatOutputStreamoperator<< (const char32_t *value)
 
FormatOutputStreamoperator<< (const MemorySpan &span)
 
FormatOutputStreamoperator<< (const void *value)
 
template<class TYPE >
FormatOutputStreamoperator<< (Reference< TYPE > value)
 
FormatOutputStreamoperator<< (const Literal &literal)
 
FormatOutputStreamoperator<< (const WideLiteral &literal)
 
FormatOutputStreamoperator<< (const Exception &e)
 
 ~FormatOutputStream ()
 
- Public Member Functions inherited from BufferedOutputStream
 BufferedOutputStream (OutputStream &out, unsigned int size=DEFAULT_BUFFER_SIZE)
 
unsigned int write (const uint8 *buffer, unsigned int size, bool nonblocking=false)
 
void unfoldValue (char value, unsigned int count)
 
 ~BufferedOutputStream ()
 
- Public Member Functions inherited from FilterOutputStream
 FilterOutputStream (OutputStream &out)
 
OutputStreamgetOutputStream () noexcept
 
void close ()
 
unsigned int write (const uint8 *buffer, unsigned int size, bool nonblocking=false)
 
- Public Member Functions inherited from Stream
virtual ~Stream () noexcept(false)
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Additional Inherited Members

- Public Types inherited from FormatOutputStream
typedef SpinLock Guard
 
- Static Public Attributes inherited from StringOutputStream
static const MemorySize DEFAULT_CAPACITY = 1024
 
- Static Public Attributes inherited from FormatOutputStream
static const unsigned int DEFAULT_FLAGS
 
static const Symbols::EndOfLine DEFAULT_EOL = Symbols::UNIXEOL
 
static const Symbols::Base DEFAULT_INTEGER_BASE = Symbols::DECIMAL
 
static const Symbols::Base DEFAULT_REAL_BASE = Symbols::DECIMAL
 
static const Symbols::RealStyle DEFAULT_REAL_STYLE = Symbols::FIXED
 
static const int DEFAULT_RADIX_POSITION = 0
 
static const Symbols::MajorDateFormat DEFAULT_MAJOR_DATE_FORMAT
 
static const Symbols::NamedDateFormat DEFAULT_NAMED_DATE_FORMAT
 
static const Symbols::Justification DEFAULT_JUSTIFICATION
 
static const int DEFAULT_WIDTH = 0
 
static const int DEFAULT_PRECISION = 6
 
static constexpr unsigned int MAXIMUM_WIDTH = 128
 
static constexpr unsigned int MAXIMUM_PRECISION = 64
 
static constexpr unsigned int MAXIMUM_SIZE = 256
 
- Static Public Attributes inherited from BufferedOutputStream
static const unsigned int DEFAULT_BUFFER_SIZE = 4096
 
static const unsigned int MINIMUM_BUFFER_SIZE = 1024
 
- Protected Types inherited from FormatOutputStream
typedef SpinLock Guard
 
- Protected Member Functions inherited from FormatOutputStream
 FormatOutputStream (OutputStream &out, unsigned int size=DEFAULT_BUFFER_SIZE)
 
 FormatOutputStream (const FormatOutputStream &copy)=delete
 
void reset () noexcept
 
bool isANSITerminal ()
 
FormatOutputStreamsetRadixPosition (unsigned int position) noexcept
 
FormatOutputStreamsetJustification (Symbols::Justification justification) noexcept
 
FormatOutputStreamsetWidth (unsigned int width) noexcept
 
FormatOutputStreamsetPrecision (unsigned int precision) noexcept
 
FormatOutputStreamsetDateFormat (const String &format)
 
void setLocale (const Locale &locale) noexcept
 
unsigned int getFlags () const noexcept
 
void setFlags (unsigned int flags) noexcept
 
Symbols::Base getBase () const noexcept
 
Symbols::Base getRealBase () const noexcept
 
unsigned int getWidth () const noexcept
 
unsigned int getPrecision () const noexcept
 
FormatOutputStreamoperator<< (Action action)
 
FormatOutputStreamoperator<< (Indent indent)
 
FormatOutputStreamoperator<< (TabIndent indent)
 
void indent (unsigned int size, bool useTab=false)
 
void addCharacterField (const char *buffer, MemorySize size)
 
void addCharacterField (const wchar *buffer, MemorySize size)
 
void addCharacterField (const char16_t *buffer, MemorySize size)
 
void addCharacterField (const char32_t *buffer, MemorySize size)
 
void addIntegerField (const char *buffer, MemorySize size, bool isSigned)
 
void addDateField (const Date &date)
 
void writeFloatingPointType (unsigned int significant, unsigned int *mantissa, unsigned int mantissaSize, int base2Exponent, unsigned int valueFlags)
 
FormatOutputStreamgetContext (Context &context) noexcept
 
FormatOutputStreamsetContext (const Context &context) noexcept
 
FormatOutputStreamoperator<< (const SourceCodeLocation &location)
 
template<MemorySize SIZE>
FormatOutputStreamoperator<< (const char(&literal)[SIZE])
 
FormatOutputStreamoperator<< (bool value)
 
FormatOutputStreamoperator<< (char value)
 
FormatOutputStreamoperator<< (wchar value)
 
FormatOutputStreamoperator<< (short int value)
 
FormatOutputStreamoperator<< (unsigned short int value)
 
FormatOutputStreamoperator<< (int value)
 
FormatOutputStreamoperator<< (unsigned int value)
 
FormatOutputStreamoperator<< (long value)
 
FormatOutputStreamoperator<< (unsigned long value)
 
FormatOutputStreamoperator<< (long long value)
 
FormatOutputStreamoperator<< (unsigned long long value)
 
FormatOutputStreamoperator<< (int128 value)
 
FormatOutputStreamoperator<< (uint128 value)
 
FormatOutputStreamoperator<< (float value)
 
FormatOutputStreamoperator<< (double value)
 
FormatOutputStreamoperator<< (long double value)
 
FormatOutputStreamoperator<< (float128 value)
 
FormatOutputStreamoperator<< (const NativeString &value)
 
FormatOutputStreamoperator<< (const NativeWideString &value)
 
FormatOutputStreamoperator<< (const char *value)
 
FormatOutputStreamoperator<< (const wchar *value)
 
FormatOutputStreamoperator<< (const char16_t *value)
 
FormatOutputStreamoperator<< (const char32_t *value)
 
FormatOutputStreamoperator<< (const MemorySpan &span)
 
FormatOutputStreamoperator<< (const void *value)
 
template<class TYPE >
FormatOutputStreamoperator<< (Reference< TYPE > value)
 
FormatOutputStreamoperator<< (const Literal &literal)
 
FormatOutputStreamoperator<< (const WideLiteral &literal)
 
FormatOutputStreamoperator<< (const Exception &e)
 
 ~FormatOutputStream ()
 
- Protected Member Functions inherited from BufferedOutputStream
 BufferedOutputStream (OutputStream &out, unsigned int size=DEFAULT_BUFFER_SIZE)
 
unsigned int write (const uint8 *buffer, unsigned int size, bool nonblocking=false)
 
void unfoldValue (char value, unsigned int count)
 
 ~BufferedOutputStream ()
 
- Protected Member Functions inherited from FilterOutputStream
 FilterOutputStream (OutputStream &out)
 
OutputStreamgetOutputStream () noexcept
 
void close ()
 
unsigned int write (const uint8 *buffer, unsigned int size, bool nonblocking=false)
 
- Protected Member Functions inherited from Stream
virtual ~Stream () noexcept(false)
 
- Protected Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Protected Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 
- Protected Attributes inherited from StringOutputStreamImpl
StringOutputStreamWrapper stream
 
- Protected Attributes inherited from FormatOutputStream
Guard guard
 
Context defaultContext
 
Context context
 
- Protected Attributes inherited from BufferedOutputStream
Allocator< uint8 > buffer
 
unsigned int writeHead = 0
 
unsigned int readHead = 0
 
- Protected Attributes inherited from FilterOutputStream
OutputStreamout
 
- Static Protected Attributes inherited from FormatOutputStream
static const Context DEFAULT_CONTEXT
 
static const unsigned int DEFAULT_FLAGS
 
static const Symbols::EndOfLine DEFAULT_EOL = Symbols::UNIXEOL
 
static const Symbols::Base DEFAULT_INTEGER_BASE = Symbols::DECIMAL
 
static const Symbols::Base DEFAULT_REAL_BASE = Symbols::DECIMAL
 
static const Symbols::RealStyle DEFAULT_REAL_STYLE = Symbols::FIXED
 
static const int DEFAULT_RADIX_POSITION = 0
 
static const Symbols::MajorDateFormat DEFAULT_MAJOR_DATE_FORMAT
 
static const Symbols::NamedDateFormat DEFAULT_NAMED_DATE_FORMAT
 
static const Symbols::Justification DEFAULT_JUSTIFICATION
 
static const int DEFAULT_WIDTH = 0
 
static const int DEFAULT_PRECISION = 6
 
static constexpr unsigned int MAXIMUM_WIDTH = 128
 
static constexpr unsigned int MAXIMUM_PRECISION = 64
 
static constexpr unsigned int MAXIMUM_SIZE = 256
 
- Static Protected Attributes inherited from BufferedOutputStream
static const unsigned int DEFAULT_BUFFER_SIZE = 4096
 
static const unsigned int MINIMUM_BUFFER_SIZE = 1024
 

Detailed Description

Use this like StringOutputStream to get nice formatted output.