⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vmtrace.h

📁 TOOL (Tiny Object Oriented Language) is an easily-embedded, object-oriented, C++-like-language inter
💻 H
字号:
#ifndef VM_SUPERTRACE_H_INCLUDED
#define VM_SUPERTRACE_H_INCLUDED
/*****************************************************************************/
/*                           HEADER FILE                                     */
/*****************************************************************************/
/*
       $Archive: $

      $Revision: $
          $Date: $
        $Author: $

   Description: Definition of the VMTrace class

                      TOOL And XML FORMS License
                      ==========================

                      Except where otherwise noted, all of the documentation 
                      and software included in the TOOL package is 
                      copyrighted by Michael Swartzendruber.

                      Copyright (C) 2005 Michael John Swartzendruber. 
                      All rights reserved.

                      Access to this code, whether intentional or accidental,
                      does NOT IMPLY any transfer of rights.

                      This software is provided "as-is," without any express 
                      or implied warranty. In no event shall the author be held
                      liable for any damages arising from the use of this software.

                      Permission is granted to anyone to use this software for 
                      any purpose, including commercial applications, and to 
                      alter and redistribute it, provided that the following 
                      conditions are met:

                      1. All redistributions of source code files must retain 
                         all copyright notices that are currently in place, 
                         and this list of conditions without modification.

                      2. The origin of this software must not be misrepresented;
                         you must not claim that you wrote the original software.

                      3. If you use this software in another product, an acknowledgment
                         in the product documentation would be appreciated but is
                         not required.

                      4. Modified versions in source or binary form must be plainly 
                         marked as such, and must not be misrepresented as being 
                         the original software.
*/
/*****************************************************************************/


#include "../../../stdafx.h"
#include "../APIClasses/VMString.h"

#define VMTRACEINIT( string )          VMTrace trace( string );
#define VMTRACE( string )              { trace.Output( string ); }
#define VMTRACEVAL( string, value )    { trace.Output( string, value ); }
#define VMTRACEBINVAL( string, value ) { trace.OutputBinary( string, value ); }
#define VMTRACEDUMP( variable )        { trace.Output( #variable, variable ); }
#define VMTRACEON()                    { VMTrace::TraceOn(); }
#define VMTRACEOFF()                   { VMTrace::TraceOff(); }


#if ! defined( BITBOOL )
#define BITBOOL(x) (!(!(x)))
#endif

#if !defined( bit_set )
#define bit_set(   arg, posn ) ((arg) |= (1L << (posn)))
#endif

#if !defined( bit_clear )
#define bit_clear( arg, posn ) ((arg) &= ~(1L << (posn)))
#endif

#if !defined( bit_test )
#define bit_test(  arg, posn ) BITBOOL((arg) & (1L << (posn)))
#endif

#if !defined( DIMENSION_OF )
#define DIMENSION_OF( argument ) ( sizeof( argument ) / sizeof( *( argument ) ) )
#endif

#if !defined( BIT_TEST )
#define BIT_TEST( arg, posn ) BITBOOL( ( arg ) & ( 1L << ( posn ) ) )
#endif


class VMTrace
{
public:
  VMTrace( const VMString& roFunction );
  virtual ~VMTrace( void );

protected:
  VMString m_oFunctionName;
  void     Indent( void ) const;

public:
  static int  m_iIndent;
  static bool m_bTracing;

  static  void TraceOn( void );
  static  void TraceOff( void );

  virtual void Output( VMString& roMessage ) const;
  virtual void Output( VMString& roMessage,       const int integer      ) const;
  virtual void Output( VMString& roMessage,       const UINT integer     ) const;
  virtual void Output( VMString& roMessage,       const long a_long      ) const;
  virtual void Output( VMString& roMessage,       const ULONG a_long     ) const;
  virtual void Output( VMString& roMessage,       const double a_double  ) const;
  virtual void Output( VMString& roMessage,       const VMString& string ) const;
  virtual void Output( VMString& roMessage,       const VOID * pointer   ) const;
  virtual void OutputBinary( VMString& roMessage, const ULONG a_long     ) const;
};


#endif


/*****************************************************************************/
/* Check-in history */
/*
*$Log: $
*/
/*****************************************************************************/




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -