src/tools/tRecorder.cpp File Reference

#include "tRecorder.h"
#include "tConfiguration.h"
#include "tDirectories.h"
#include "tRecorderInternal.h"

Include dependency graph for tRecorder.cpp:

Go to the source code of this file.

Defines

#define INLINE_DEF

Functions

std::ostream & operator<< (std::ostream &s, tLineString const &line)
 persistent string writing operator
std::istream & operator>> (std::istream &s, tLineString &line)
 persistent string reading operator
static int st_GetDebugLevelPlayback ()
REAL st_GetDifference (REAL a, REAL b)
REAL st_GetDifference (int a, int b)
REAL st_GetDifference (unsigned int a, unsigned int b)
REAL st_GetDifference (unsigned long int a, unsigned long int b)
REAL st_GetDifference (tString const &a, tString const &b)

Variables

static int st_debugLevelRecording = 0
static tSettingItem< int > rdb ("RECORDING_DEBUGLEVEL", st_debugLevelRecording)
static char const * st_fileOpen = "FILE_OPEN"
static char const * st_fileRead = "FILE_READ"


Define Documentation

#define INLINE_DEF

Definition at line 38 of file tRecorder.cpp.


Function Documentation

std::ostream& operator<< ( std::ostream &  s,
tLineString const &  line 
)

persistent string writing operator

Definition at line 183 of file tRecorder.cpp.

References c, and tString::Len().

00184 {
00185     // write magic character
00186     s << 'L';
00187 
00188     // print string, encode newlines
00189     for( int i=0; i<line.Len(); ++i)
00190     {
00191         char c = line[i];
00192         if ( c == '\n' )
00193             s << "\\n";
00194         if ( c == '\\' )
00195             s << "\\\\";
00196         else if ( c != '\0' )
00197             s << c;
00198     }
00199 
00200     return s << '\n';
00201 }

Here is the call graph for this function:

std::istream& operator>> ( std::istream &  s,
tLineString line 
)

persistent string reading operator

Definition at line 204 of file tRecorder.cpp.

References c, tString::Clear(), tString::ReadLine(), tString::Size(), and tASSERT.

00205 {
00206     // read magic character
00207     char c;
00208     s >> c;
00209     tASSERT( 'L' == c );
00210 
00211     tString read;
00212 
00213     // read line
00214     read.ReadLine(s);
00215 
00216     // std::cout << "Read: " << read << "\n";
00217 
00218     line.Clear();
00219 
00220     // copy line, replacing "\n" with real newline
00221     for(size_t i=0; i<read.Size(); ++i)
00222     {
00223         char c = read[i];
00224         if ( c != '\\' || i+1 == read.Size() || ( read[i+1] != 'n' && read[i+1] != '\\' ) )
00225         {
00226             line << c;
00227         }
00228         else if ( read[i+1] == '\\' )
00229         {
00230             line << "\\";
00231             i++;
00232         }
00233         else // if ( read[i+1] != 'n' )
00234         {
00235             line << "\n";
00236             i++;
00237         }
00238     }
00239 
00240     return s;
00241 }

Here is the call graph for this function:

static int st_GetDebugLevelPlayback (  )  [static]

Definition at line 559 of file tRecorder.cpp.

References tRecorder::Playback(), tRecorder::Record(), and st_debugLevelRecording.

Referenced by tRecorderSyncBase::GetDebugLevelPlayback().

00560 {
00561     // sync level with recording
00562     int level = st_debugLevelRecording;
00563     tRecorder::Playback( "DEBUGLEVEL", level );
00564     tRecorder::Record( "DEBUGLEVEL", st_debugLevelRecording );
00565 
00566     return level;
00567 }

Here is the call graph for this function:

Here is the caller graph for this function:

REAL st_GetDifference ( tString const &  a,
tString const &  b 
)

Definition at line 622 of file tRecorder.cpp.

00623 {
00624     return ( a == b ) ? 0 : 1;
00625 }

REAL st_GetDifference ( unsigned long int  a,
unsigned long int  b 
)

Definition at line 617 of file tRecorder.cpp.

References REAL.

00618 {
00619     return fabs( REAL( a - b ) );
00620 }

REAL st_GetDifference ( unsigned int  a,
unsigned int  b 
)

Definition at line 612 of file tRecorder.cpp.

References REAL.

00613 {
00614     return fabs( REAL( a - b ) );
00615 }

REAL st_GetDifference ( int  a,
int  b 
)

Definition at line 607 of file tRecorder.cpp.

References REAL.

00608 {
00609     return fabs( REAL( a - b ) );
00610 }

REAL st_GetDifference ( REAL  a,
REAL  b 
)

Definition at line 602 of file tRecorder.cpp.

00603 {
00604     return fabs( a - b );
00605 }


Variable Documentation

tSettingItem<int> rdb("RECORDING_DEBUGLEVEL", st_debugLevelRecording) [static]

int st_debugLevelRecording = 0 [static]

Definition at line 554 of file tRecorder.cpp.

Referenced by tRecorderSyncBase::GetDebugLevelRecording(), and st_GetDebugLevelPlayback().

char const* st_fileOpen = "FILE_OPEN" [static]

Definition at line 627 of file tRecorder.cpp.

Referenced by tTextFileRecorder::Open().

char const* st_fileRead = "FILE_READ" [static]

Definition at line 628 of file tRecorder.cpp.

Referenced by tTextFileRecorder::GetLine().


Generated on Sat Mar 15 23:12:19 2008 for Armagetron Advanced by  doxygen 1.5.4