SNAP Library 2.0, Developer Reference  2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TCon Class Reference

#include <console.h>

List of all members.

Public Member Functions

 TCon ()
 ~TCon ()
int PutCh (const int &Ch)
void PutBf (const void *LBf, const int &LBfL)
void Flush ()
TConoperator<< (const bool &Bool)
TConoperator<< (const uchar &UCh)
TConoperator<< (const char &Ch)
TConoperator<< (const int &Int)
TConoperator<< (const uint &Int)
TConoperator<< (const short &Sh)
TConoperator<< (const ushort &USh)
TConoperator<< (const float &Flt)
TConoperator<< (const double &Double)
TConoperator<< (const long double &LDouble)
TConoperator<< (const char *CStr)
TConoperator<< (const TStr &Str)
TConoperator<< (const TChA &ChA)
TConoperator<< (const TConManip &Mnp)
TConoperator<< (TCon &(*FuncPt)(TCon &))
void operator() (const char *FmtStr,...)

Private Member Functions

 TCon (const TCon &)
TConoperator= (const TCon &)

Detailed Description

Definition at line 19 of file console.h.


Constructor & Destructor Documentation

TCon::TCon ( const TCon ) [private]

Definition at line 3 of file console.cpp.

References IAssert.

           {
#if defined (GLib_CreateConsole)
  Ok = (AllocConsole() != 0);
  HStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  IAssert(HStdOut != INVALID_HANDLE_VALUE);
#endif
}

Definition at line 11 of file console.cpp.

References IAssert.

            {
#if defined (GLib_CreateConsole)
  if (Ok) IAssert(FreeConsole());
#endif
}

Member Function Documentation

void TCon::Flush ( ) [inline]

Definition at line 35 of file console.h.

{ }
void TCon::operator() ( const char *  FmtStr,
  ... 
)

Definition at line 65 of file console.cpp.

References PutBf().

                                                {
  static char Bf [2048];
  va_list valist;  va_start(valist, FmtStr);
  int BfL=vsnprintf(Bf, 2048, FmtStr, valist); va_end(valist);
  if (BfL!=-1){PutBf((void *) Bf, BfL);}
  else {PutBf((void *) Bf, 2048);}
}

Here is the call graph for this function:

TCon& TCon::operator<< ( const bool &  Bool) [inline]

Definition at line 37 of file console.h.

References PutCh().

{ PutCh(Bool ? 'T' : 'F'); return *this; }

Here is the call graph for this function:

TCon& TCon::operator<< ( const uchar UCh) [inline]

Definition at line 38 of file console.h.

References PutBf().

{ PutBf(&UCh, sizeof(UCh)); return *this; }

Here is the call graph for this function:

TCon& TCon::operator<< ( const char &  Ch) [inline]

Definition at line 39 of file console.h.

References PutBf().

{ PutBf(&Ch, sizeof(Ch)); return *this; }

Here is the call graph for this function:

TCon & TCon::operator<< ( const int &  Int)

Definition at line 29 of file console.cpp.

References PutBf().

                                       {
  char Bf[255];
  sprintf(Bf, "%d", Int);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

Here is the call graph for this function:

TCon & TCon::operator<< ( const uint Int)

Definition at line 36 of file console.cpp.

References PutBf().

                                         {
  char Bf[255];
  sprintf(Bf, "%u", UInt);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

Here is the call graph for this function:

TCon& TCon::operator<< ( const short &  Sh) [inline]

Definition at line 42 of file console.h.

References operator<<().

Referenced by operator<<().

{ operator<<((int) Sh); return *this; }

Here is the call graph for this function:

Here is the caller graph for this function:

TCon& TCon::operator<< ( const ushort USh) [inline]

Definition at line 43 of file console.h.

References operator<<().

Referenced by operator<<().

{ operator<<((uint) USh); return *this; }

Here is the call graph for this function:

Here is the caller graph for this function:

TCon & TCon::operator<< ( const float &  Flt)

Definition at line 43 of file console.cpp.

References PutBf().

                                         {
  char Bf[255];
  sprintf(Bf, "%g", Flt);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;

}

Here is the call graph for this function:

TCon & TCon::operator<< ( const double &  Double)

Definition at line 51 of file console.cpp.

References PutBf().

                                             {
  char Bf[255];
  sprintf(Bf, "%g", Double);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

Here is the call graph for this function:

TCon & TCon::operator<< ( const long double &  LDouble)

Definition at line 58 of file console.cpp.

References PutBf().

                                                   {
  char Bf[255];
  sprintf(Bf, "%Lg", LDouble);
  PutBf((void *) Bf, int(strlen(Bf)));
  return *this;
}

Here is the call graph for this function:

TCon& TCon::operator<< ( const char *  CStr) [inline]

Definition at line 47 of file console.h.

References PutBf().

{ PutBf(CStr, int(strlen(CStr))); return *this; }

Here is the call graph for this function:

TCon& TCon::operator<< ( const TStr Str) [inline]

Definition at line 48 of file console.h.

References TStr::CStr(), TStr::Len(), and PutBf().

{ PutBf(Str.CStr(), Str.Len()); return *this; }

Here is the call graph for this function:

TCon& TCon::operator<< ( const TChA ChA) [inline]

Definition at line 49 of file console.h.

References TChA::CStr(), TChA::Len(), and PutBf().

{ PutBf(ChA.CStr(), ChA.Len()); return *this; }

Here is the call graph for this function:

TCon& TCon::operator<< ( const TConManip Mnp) [inline]

Definition at line 50 of file console.h.

{ return Mnp(*this); }
TCon& TCon::operator<< ( TCon &(*)(TCon &)  FuncPt) [inline]

Definition at line 51 of file console.h.

{ return FuncPt(*this); }
TCon& TCon::operator= ( const TCon ) [private]
void TCon::PutBf ( const void *  LBf,
const int &  LBfL 
)

Definition at line 17 of file console.cpp.

References IAssert.

Referenced by operator()(), operator<<(), and PutCh().

                                                 {
#if defined (GLib_Console)
  #if defined (GLib_CreateConsole)
    DWORD ChsWritten;
    WriteConsole(HStdOut, LBf, LBfL, &ChsWritten, 0);
    IAssert(ChsWritten == static_cast<DWORD>(LBfL));
  #else
    fwrite(LBf, sizeof(char), LBfL, stdout);
  #endif
#endif
}

Here is the caller graph for this function:

int TCon::PutCh ( const int &  Ch) [inline]

Definition at line 33 of file console.h.

References PutBf().

Referenced by Eol(), operator<<(), Spc(), and Tab().

{ PutBf((void *) &Ch, 1);  return Ch; }

Here is the call graph for this function:

Here is the caller graph for this function:


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