#include <script_debug_source.h>
Inheritance diagram for NLAISCRIPT::CScriptDebugSourceFile:
Nevrax France
Definition at line 72 of file script_debug_source.h.
Public Member Functions | |
const NLAIC::IBasicType * | clone () const |
CScriptDebugSourceFile (const char *sourceName, bool file=true) | |
Constructor. | |
sint32 | decRef () |
Decrement the reference of an object. | |
virtual void | getDebugString (std::string &) const |
virtual const std::string | getInfo () |
const sint32 & | getRef () const |
get the refence count. | |
std::string | getSourceBuffer () const |
Return the entire source buffer. | |
virtual std::string | getSourceName () const |
Return a name for the script source. | |
const NLAIC::CIdentType & | getType () const |
void | incRef () |
Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list. | |
void | load (NLMISC::IStream &) |
Load the class from a stream. | |
const NLAIC::IBasicType * | newInstance () const |
virtual void | release () |
Release allow to release the pointer. The last release when the _Ref is nul delete the object. | |
void | save (NLMISC::IStream &) |
Save the class in a stream. | |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
Static Public Attributes | |
const NLAIC::CIdentType | IdScriptDebugSourceFile |
Protected Attributes | |
std::string | _SourceName |
Private Attributes | |
bool | isMemory |
std::string | MemoryScript |
|
Constructor.
Definition at line 56 of file script_debug_source.cpp. References file, and MemoryScript. Referenced by clone(), and newInstance().
00056 : 00057 IScriptDebugSource((file) ? sourceName : "memoryScript"), isMemory(!file) 00058 { 00059 if(!file) MemoryScript = sourceName; 00060 } |
|
This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne. Implements NLAIC::IBasicType. Definition at line 109 of file script_debug_source.cpp. References CScriptDebugSourceFile(), and x.
00110 { 00111 NLAIC::IBasicType *x = new CScriptDebugSourceFile(*this); 00112 return x; 00113 } |
|
Decrement the reference of an object.
Definition at line 93 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIC::IPointerGestion::release(), and NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00094 {
00095 return --_Ref;
00096 }
|
|
Implements NLMISC::IClassable. Reimplemented in NLAIC::CIdentType. Definition at line 116 of file abstract_interface.h. Referenced by NLAISCRIPT::CAgentClass::isClassInheritedFrom().
00117 { 00118 return std::string("<unnamed>"); 00119 } |
|
This is a Debug function, text is an character pointer to receive the debug text output, the debug text containe all think sensible to interset user. Implements NLAIC::IBasicType. Definition at line 121 of file script_debug_source.cpp.
00122 { 00123 text += "CScriptDebugSourceFile<"; 00124 text += _SourceName; 00125 text += ">"; 00126 } |
|
Definition at line 292 of file abstract_interface.h. References NLAIC::IBasicType::getDebugString(), and s.
00293 { 00294 std::string s; 00295 getDebugString(s); 00296 return s; 00297 } |
|
get the refence count.
Definition at line 99 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00100 {
00101 return _Ref;
00102 }
|
|
Return the entire source buffer.
Implements NLAISCRIPT::IScriptDebugSource. Definition at line 63 of file script_debug_source.cpp. References isMemory, MemoryScript, sint32, and size.
00064 { 00065 if(!isMemory) 00066 { 00067 FILE* f; 00068 sint32 size; 00069 char* buf; 00070 std::string ret; 00071 00072 // Read the file 00073 f = fopen(_SourceName.c_str(),"rb"); 00074 fseek(f,0,SEEK_END); 00075 size = ftell(f); 00076 rewind(f); 00077 buf = new char [size + 4]; 00078 fread(buf+1, sizeof( char ), size, f); 00079 fclose(f); 00080 buf[0] = ' '; 00081 buf[size+1] = '\n'; 00082 buf[size+2] = 0; 00083 00084 ret = buf; 00085 delete[] buf; 00086 00087 return ret; 00088 } 00089 else return MemoryScript; 00090 } |
|
Return a name for the script source.
Definition at line 44 of file script_debug_source.cpp. Referenced by NLAISCRIPT::CCodeBrancheRunDebug::getSourceFileName().
00045 { 00046 return _SourceName; 00047 } |
|
getType return a unique string how represente the class, it can be the name of the class. This function is used for the sytem regstry class (see the definition of the template class Gen::CRegistry). Implements NLAIC::IBasicType. Definition at line 104 of file script_debug_source.cpp. References IdScriptDebugSourceFile.
00105 { 00106 return IdScriptDebugSourceFile; 00107 } |
|
|
Load the class from a stream.
Implements NLAISCRIPT::IScriptDebugSource. Definition at line 99 of file script_debug_source.cpp. References NLMISC::IStream::serial().
00100 { 00101 is.serial(_SourceName); 00102 } |
|
This function allow a new instance, that mean that the class is a class factory. Implements NLAIC::IBasicType. Definition at line 115 of file script_debug_source.cpp. References CScriptDebugSourceFile(), and x.
00116 { 00117 NLAIC::IBasicType *x = new CScriptDebugSourceFile(""); 00118 return x; 00119 } |
|
|
Save the class in a stream.
Implements NLAISCRIPT::IScriptDebugSource. Definition at line 93 of file script_debug_source.cpp. References NLMISC::IStream::serial().
00094 { 00095 os.serial(_SourceName); 00096 } |
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 328 of file abstract_interface.h. References NLAIC::IBasicInterface::load(), and NLAIC::IBasicInterface::save().
|
|
Definition at line 62 of file script_debug_source.h. |
|
Referenced by getType(). |
|
Definition at line 79 of file script_debug_source.h. Referenced by getSourceBuffer(). |
|
Definition at line 78 of file script_debug_source.h. Referenced by CScriptDebugSourceFile(), and getSourceBuffer(). |