================ rvDebuggerScript::Load Loads the debugger script and attempts to compile it using the method appropriate for the file being loaded. If the script cant be compiled the loading of the script fails ================ */
| 91 | ================ |
| 92 | */ |
| 93 | bool rvDebuggerScript::Load ( const char* filename ) |
| 94 | { |
| 95 | void* buffer; |
| 96 | int size; |
| 97 | |
| 98 | // Unload the script before reloading it |
| 99 | Unload ( ); |
| 100 | |
| 101 | // Cache the filename used to load the script |
| 102 | mFilename = filename; |
| 103 | |
| 104 | // Read in the file |
| 105 | size = fileSystem->ReadFile ( filename, &buffer, &mModifiedTime ); |
| 106 | if ( buffer == NULL ) |
| 107 | { |
| 108 | return false; |
| 109 | } |
| 110 | |
| 111 | // Copy the buffer over |
| 112 | mContents = new char [ size + 1 ]; |
| 113 | memcpy ( mContents, buffer, size ); |
| 114 | mContents[size] = 0; |
| 115 | |
| 116 | // Cleanup |
| 117 | fileSystem->FreeFile ( buffer ); |
| 118 | |
| 119 | return true; |
| 120 | } |
| 121 | |
| 122 | /* |
| 123 | ================ |
no test coverage detected