Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
ON_TextLog Class Reference

#include <opennurbs_textlog.h>

Inheritance diagram for ON_TextLog:
CRhinoDump CRhinoTextOutTextLog ON_TextHash

Public Types

enum  LevelOfDetail : unsigned char { LevelOfDetail::Minimum = 0, LevelOfDetail::Medium = 1, LevelOfDetail::Maximum = 2 }
 ON_TextLog::LevelOfDetail determines ow much detail is printed. Functions that have an ON_TextLog parameter, like the Dump() functions, may use the level of detail to tailor their output. may use the level of detail to tailor their output. More...
 

Public Member Functions

 ON_TextLog ()
 
 ON_TextLog (FILE *fp)
 dump to open ASCII text file More...
 
 ON_TextLog (ON_wString &s)
 
virtual ~ON_TextLog ()
 
void ClearColorFormat ()
 
ON_TextLog::LevelOfDetail DecreaseLevelOfDetail ()
 Decrease the level of detail. More...
 
ON_Color::TextFormat GetColorFormat ()
 
void GetDoubleFormat (ON_String &) const
 
void GetFloatFormat (ON_String &) const
 
ON_TextLog::LevelOfDetail GetLevelOfDetail () const
 
ON_TextLog::LevelOfDetail IncreaseLevelOfDetail ()
 Increase the level of detail. More...
 
int IndentCount ()
 
int IndentSize () const
 
bool IsNull () const
 
bool IsTextHash () const
 
bool LevelOfDetailIsAtLeast (ON_TextLog::LevelOfDetail level_of_detail)
 
ON_TextLogoperator<< (char)
 
ON_TextLogoperator<< (const char *)
 
ON_TextLogoperator<< (const ON_2dPoint &)
 
ON_TextLogoperator<< (const ON_2dVector &)
 
ON_TextLogoperator<< (const ON_3dPoint &)
 
ON_TextLogoperator<< (const ON_3dVector &)
 
ON_TextLogoperator<< (const ON_4dPoint &)
 
ON_TextLogoperator<< (const ON_Xform &)
 
ON_TextLogoperator<< (double)
 
ON_TextLogoperator<< (float)
 
ON_TextLogoperator<< (int)
 
ON_TextLogoperator<< (short)
 
void PopIndent ()
 
void ON_VARGS_FUNC_CDECL Print (const char *format,...)
 
void Print (const ON_2dPoint &)
 
void Print (const ON_2dVector &)
 
void Print (const ON_3dPoint &)
 
void Print (const ON_3dPointArray &, const char *=nullptr)
 
void Print (const ON_3dVector &)
 
void Print (const ON_4dPoint &)
 
void Print (const ON_COMPONENT_INDEX &)
 
void Print (const ON_Matrix &, const char *=nullptr, int=0)
 
void Print (const ON_String &string)
 
void Print (const ON_UUID &)
 
void Print (const ON_wString &string)
 
void Print (const ON_Xform &)
 
void ON_VARGS_FUNC_CDECL Print (const wchar_t *format,...)
 
void Print (double)
 
void Print (float)
 
void PrintColor (const ON_Color &color)
 
void PrintCurrentTime ()
 
void PrintKnotVector (int, int, const double *)
 
void PrintNewLine ()
 printing utilities More...
 
void PrintPointGrid (int, bool, int, int, int, int, const double *, const char *=nullptr)
 
void PrintPointList (int, bool, int, int, const double *, const char *=nullptr)
 
void PrintRGB (const ON_Color &color)
 
void PrintSpace ()
 
void PrintString (const char *s)
 
void PrintString (const wchar_t *s)
 
void PrintString (ON_String s)
 
void PrintString (ON_wString s)
 
void PrintTab ()
 
void PrintTime (const struct tm &t)
 
void PrintWrappedText (const char *, int=60)
 last arg is maximum line length More...
 
void PrintWrappedText (const wchar_t *, int=60)
 last arg is maximum line length More...
 
void PushIndent ()
 
void SetColorFormat (ON_Color::TextFormat color_format)
 
void SetDoubleFormat (const char *)
 default is g More...
 
void SetFloatFormat (const char *)
 default is g More...
 
void SetIndentCount (int indent_count)
 
void SetIndentSize (int)
 
void SetLevelOfDetail (ON_TextLog::LevelOfDetail level_of_detail)
 

Static Public Member Functions

static ON_TextLog::LevelOfDetail LevelOfDetailFromUnsigned (unsigned int level_of_detail)
 

Static Public Attributes

static ON_TextLog Null
 

Protected Member Functions

virtual void AppendText (const char *s)
 
virtual void AppendText (const wchar_t *s)
 

Protected Attributes

FILE * m_pFile = nullptr
 
ON_wStringm_pString = nullptr
 

Friends

class ON_TextHash
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ LevelOfDetail

enum ON_TextLog::LevelOfDetail : unsigned char
strong

ON_TextLog::LevelOfDetail determines ow much detail is printed. Functions that have an ON_TextLog parameter, like the Dump() functions, may use the level of detail to tailor their output. may use the level of detail to tailor their output.

Level of detail interface

Enumerator
Minimum 

A brief summary or synopsis.

Medium 

The default level of detail.

Maximum 

A verbose description that may be so long it obscures the important points.

Constructor & Destructor Documentation

◆ ON_TextLog() [1/3]

ON_TextLog::ON_TextLog ( )

Description: Create a text log that dumps to the virtual function void ON_TextLog::AppendText().

◆ ON_TextLog() [2/3]

ON_TextLog::ON_TextLog ( FILE *  fp)

dump to open ASCII text file

Description: Create a text log that dumps to an ASCII file. Parameters: fp - [in] Pointer to an open ASCII text file. The file pointer must remain valid as long as the text log is in use.

◆ ON_TextLog() [3/3]

ON_TextLog::ON_TextLog ( ON_wString s)

Description: Create a text log that dumps to a string. Parameters: s - [in] String that must exist as long as the text log is in use.

◆ ~ON_TextLog()

virtual ON_TextLog::~ON_TextLog ( )
virtual

Member Function Documentation

◆ AppendText() [1/2]

virtual void ON_TextLog::AppendText ( const char *  s)
protectedvirtual

Description: If the ON_TextLog(ON_wString& wstr) constructor was used, the default appends s to wstr. If the ON_TextLog(FILE* fp) constructor was used, the default calls fputs( fp, s). In all other cases, the default calls printf("%s",s). Parameters: s - [in];

Reimplemented in CRhinoDump.

◆ AppendText() [2/2]

virtual void ON_TextLog::AppendText ( const wchar_t *  s)
protectedvirtual

Description: If the ON_TextLog(ON_wString& wstr) constructor was used, the default appends s to wstr. In all other cases, the default converts the string to an ON_String and calls the ASCII version AppendText(const char*). Parameters: s - [in];

Reimplemented in CRhinoDump.

◆ ClearColorFormat()

void ON_TextLog::ClearColorFormat ( )

Description: Returns color format to the default ON_Color::TextFormat::DecimalRGBa

◆ DecreaseLevelOfDetail()

ON_TextLog::LevelOfDetail ON_TextLog::DecreaseLevelOfDetail ( )

Decrease the level of detail.

Returns
Level of detail to restore when this scope of decreased detail is finished.

◆ GetColorFormat()

ON_Color::TextFormat ON_TextLog::GetColorFormat ( )

◆ GetDoubleFormat()

void ON_TextLog::GetDoubleFormat ( ON_String ) const

◆ GetFloatFormat()

void ON_TextLog::GetFloatFormat ( ON_String ) const

◆ GetLevelOfDetail()

ON_TextLog::LevelOfDetail ON_TextLog::GetLevelOfDetail ( ) const

Returns: Level of detail to print 0 = minimum level of detail 4 = maximum level of detail

◆ IncreaseLevelOfDetail()

ON_TextLog::LevelOfDetail ON_TextLog::IncreaseLevelOfDetail ( )

Increase the level of detail.

Returns
Level of detail to restore when this scope of increased detail is finished.

◆ IndentCount()

int ON_TextLog::IndentCount ( )

Returns: Current indentation count

◆ IndentSize()

int ON_TextLog::IndentSize ( ) const

0: one tab per indent >0: number of spaces per indent

◆ IsNull()

bool ON_TextLog::IsNull ( ) const

Returns: True if this is ON_TextLog::Null.

◆ IsTextHash()

bool ON_TextLog::IsTextHash ( ) const

Returns: True if the text is being used to calculate a geometric content SHA1 hash and non-geometry information that varies based on time, computer, or user should not be printed.

◆ LevelOfDetailFromUnsigned()

static ON_TextLog::LevelOfDetail ON_TextLog::LevelOfDetailFromUnsigned ( unsigned int  level_of_detail)
static

◆ LevelOfDetailIsAtLeast()

bool ON_TextLog::LevelOfDetailIsAtLeast ( ON_TextLog::LevelOfDetail  level_of_detail)

Parameter: level_of_detail - [in] Returns: True if this text log's level of detail the same or more detailed than the amount specified by level_of_detail.

◆ operator<<() [1/12]

ON_TextLog& ON_TextLog::operator<< ( char  )

◆ operator<<() [2/12]

ON_TextLog& ON_TextLog::operator<< ( const char *  )

◆ operator<<() [3/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_2dPoint )

◆ operator<<() [4/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_2dVector )

◆ operator<<() [5/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_3dPoint )

◆ operator<<() [6/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_3dVector )

◆ operator<<() [7/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_4dPoint )

◆ operator<<() [8/12]

ON_TextLog& ON_TextLog::operator<< ( const ON_Xform )

◆ operator<<() [9/12]

ON_TextLog& ON_TextLog::operator<< ( double  )

◆ operator<<() [10/12]

ON_TextLog& ON_TextLog::operator<< ( float  )

◆ operator<<() [11/12]

ON_TextLog& ON_TextLog::operator<< ( int  )

◆ operator<<() [12/12]

ON_TextLog& ON_TextLog::operator<< ( short  )

◆ PopIndent()

void ON_TextLog::PopIndent ( )

◆ Print() [1/16]

void ON_VARGS_FUNC_CDECL ON_TextLog::Print ( const char *  format,
  ... 
)

Description: Print a formatted ASCII string of up to 2000 characters. Parameters: format - [in] nullptr terminated format control string Remarks: To print strings longer than 2000 characters, you must use ON_TextLog::PrintString. See Also: ON_TextLog::PrintString

◆ Print() [2/16]

void ON_TextLog::Print ( const ON_2dPoint )

◆ Print() [3/16]

void ON_TextLog::Print ( const ON_2dVector )

◆ Print() [4/16]

void ON_TextLog::Print ( const ON_3dPoint )

◆ Print() [5/16]

void ON_TextLog::Print ( const ON_3dPointArray ,
const char *  = nullptr 
)

◆ Print() [6/16]

void ON_TextLog::Print ( const ON_3dVector )

◆ Print() [7/16]

void ON_TextLog::Print ( const ON_4dPoint )

◆ Print() [8/16]

void ON_TextLog::Print ( const ON_COMPONENT_INDEX )

◆ Print() [9/16]

void ON_TextLog::Print ( const ON_Matrix ,
const char *  = nullptr,
int  = 0 
)

◆ Print() [10/16]

void ON_TextLog::Print ( const ON_String string)

Description: Print an unformatted UTF-8 string of any length. Parameters: string - [in]

◆ Print() [11/16]

void ON_TextLog::Print ( const ON_UUID )

◆ Print() [12/16]

void ON_TextLog::Print ( const ON_wString string)

Description: Print an unformatted wide char string of any length. Parameters: string - [in]

◆ Print() [13/16]

void ON_TextLog::Print ( const ON_Xform )

◆ Print() [14/16]

void ON_VARGS_FUNC_CDECL ON_TextLog::Print ( const wchar_t *  format,
  ... 
)

Description: Print a formatted UNICODE string of up to 2000 characters. Parameters: format - [in] nullptr terminated format control string Remarks: To print strings longer than 2000 characters, you must use ON_TextLog::PrintString. See Also: ON_TextLog::PrintString

◆ Print() [15/16]

void ON_TextLog::Print ( double  )

◆ Print() [16/16]

void ON_TextLog::Print ( float  )

◆ PrintColor()

void ON_TextLog::PrintColor ( const ON_Color color)

Description: Print color using ON_Color::ToText(this->GetColorFormat(),0,true,*this);

◆ PrintCurrentTime()

void ON_TextLog::PrintCurrentTime ( )

Description: Prints the current Universal Coordinated Time returned by the gmtime() function in English. weekday month date::hour::min::sec year

◆ PrintKnotVector()

void ON_TextLog::PrintKnotVector ( int  ,
int  ,
const double *   
)

◆ PrintNewLine()

void ON_TextLog::PrintNewLine ( )

printing utilities

Description: Same as calling Print("\n");

◆ PrintPointGrid()

void ON_TextLog::PrintPointGrid ( int  ,
bool  ,
int  ,
int  ,
int  ,
int  ,
const double *  ,
const char *  = nullptr 
)

◆ PrintPointList()

void ON_TextLog::PrintPointList ( int  ,
bool  ,
int  ,
int  ,
const double *  ,
const char *  = nullptr 
)

◆ PrintRGB()

void ON_TextLog::PrintRGB ( const ON_Color color)

Description: Print color using the format ON_Color::TextFormat::DecimalRGB.

◆ PrintSpace()

void ON_TextLog::PrintSpace ( )

Description: Same as calling Print(" ");

◆ PrintString() [1/4]

void ON_TextLog::PrintString ( const char *  s)

Description: Print an unformatted UTF-8 encoded null terminated string. Parameters: s - [in] UTF-8 encoded null terminated string.

◆ PrintString() [2/4]

void ON_TextLog::PrintString ( const wchar_t *  s)

Description: Print an unformatted UTF-16 or UTF-32 encoded null terminated string. Parameters: s - [in] UTF-16 or UTF-32 encoded null terminated string.

◆ PrintString() [3/4]

void ON_TextLog::PrintString ( ON_String  s)

◆ PrintString() [4/4]

void ON_TextLog::PrintString ( ON_wString  s)

◆ PrintTab()

void ON_TextLog::PrintTab ( )

Description: Same as calling Print("\t");

◆ PrintTime()

void ON_TextLog::PrintTime ( const struct tm &  t)

Description: Prints the time in the t parameter as Universal Coordinated Time in English. weekday month date::hour::min::sec year Parameters: t - [in]

◆ PrintWrappedText() [1/2]

void ON_TextLog::PrintWrappedText ( const char *  ,
int  = 60 
)

last arg is maximum line length

◆ PrintWrappedText() [2/2]

void ON_TextLog::PrintWrappedText ( const wchar_t *  ,
int  = 60 
)

last arg is maximum line length

◆ PushIndent()

void ON_TextLog::PushIndent ( )

◆ SetColorFormat()

void ON_TextLog::SetColorFormat ( ON_Color::TextFormat  color_format)

◆ SetDoubleFormat()

void ON_TextLog::SetDoubleFormat ( const char *  )

default is g

◆ SetFloatFormat()

void ON_TextLog::SetFloatFormat ( const char *  )

default is g

◆ SetIndentCount()

void ON_TextLog::SetIndentCount ( int  indent_count)

Description: Set indentation count.

◆ SetIndentSize()

void ON_TextLog::SetIndentSize ( int  )

◆ SetLevelOfDetail()

void ON_TextLog::SetLevelOfDetail ( ON_TextLog::LevelOfDetail  level_of_detail)

Description: Set the level of detail to print. Parameters: level_of_detail - [in] (default = ON_TextLog::LevelOfDetail::Medium)

Friends And Related Function Documentation

◆ ON_TextHash

friend class ON_TextHash
friend

Member Data Documentation

◆ m_pFile

FILE* ON_TextLog::m_pFile = nullptr
protected

◆ m_pString

ON_wString* ON_TextLog::m_pString = nullptr
protected

◆ Null

ON_TextLog ON_TextLog::Null
static

Description: ON_TextLog::Null is a silent text log and can be used when no output is desired but an ON_TextLog parameter is required.