LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[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 39 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 50 of file Format.h.

Member Function Documentation

◆ home()

void format_object_base::home ( )
protectedvirtual

Definition at line 560 of file raw_ostream.cpp.

◆ 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 55 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 41 of file Format.h.


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