LLVM 22.0.0git
llvm::format_object_base Class Referenceabstract

This is a helper class used for handling formatted output. More...

#include "llvm/Support/Format.h"

Inheritance diagram for llvm::format_object_base:
[legend]

Public Member Functions

 format_object_base (const char *fmt)
unsigned print (char *Buffer, unsigned BufferSize) const
 Format the object into the specified buffer.

Protected Member Functions

 ~format_object_base ()=default
 format_object_base (const format_object_base &)=default
virtual void home ()
virtual int snprint (char *Buffer, unsigned BufferSize) const =0
 Call snprintf() for this object, on the given buffer and size.

Protected Attributes

const charFmt

Detailed Description

This is a helper class used for handling formatted output.

It is the abstract base class of a templated derived class.

Definition at line 40 of file Format.h.

Constructor & Destructor Documentation

◆ ~format_object_base()

llvm::format_object_base::~format_object_base ( )
protecteddefault

◆ format_object_base() [1/2]

llvm::format_object_base::format_object_base ( const format_object_base & )
protecteddefault

◆ format_object_base() [2/2]

llvm::format_object_base::format_object_base ( const char * fmt)
inline

Definition at line 51 of file Format.h.

References Fmt.

Member Function Documentation

◆ home()

void format_object_base::home ( )
protectedvirtual

Definition at line 558 of file raw_ostream.cpp.

Referenced by format_object_base().

◆ print()

unsigned llvm::format_object_base::print ( char * Buffer,
unsigned BufferSize ) const
inline

Format the object into the specified buffer.

On success, this returns the length of the formatted string. If the buffer is too small, this returns a length to retry with, which will be larger than BufferSize.

Definition at line 56 of file Format.h.

References assert(), N, and snprint().

Referenced by llvm::raw_ostream::operator<<().

◆ snprint()

virtual int llvm::format_object_base::snprint ( char * Buffer,
unsigned BufferSize ) const
protectedpure virtual

Call snprintf() for this object, on the given buffer and size.

Implemented in llvm::format_object< Ts >.

Referenced by print().

Member Data Documentation

◆ Fmt

const char* llvm::format_object_base::Fmt
protected

Definition at line 42 of file Format.h.

Referenced by format_object_base().


The documentation for this class was generated from the following files: