Returns 1 if the section was included Returns 0 if the section was not included because it had already been included before Returns <0 if there was an error
| 95 | // Returns 0 if the section was not included because it had already been included before |
| 96 | // Returns <0 if there was an error |
| 97 | int CScriptBuilder::AddSectionFromFile(const char *filename) |
| 98 | { |
| 99 | // The file name stored in the set should be the fully resolved name because |
| 100 | // it is possible to name the same file in multiple ways using relative paths. |
| 101 | string fullpath = GetAbsolutePath(filename); |
| 102 | |
| 103 | if( IncludeIfNotAlreadyIncluded(fullpath.c_str()) ) |
| 104 | { |
| 105 | int r = LoadScriptSection(fullpath.c_str()); |
| 106 | if( r < 0 ) |
| 107 | return r; |
| 108 | else |
| 109 | return 1; |
| 110 | } |
| 111 | |
| 112 | return 0; |
| 113 | } |
| 114 | |
| 115 | // Returns 1 if the section was included |
| 116 | // Returns 0 if the section was not included because it had already been included before |