MCPcopy Create free account
hub / github.com/anjo76/angelscript / AddSectionFromFile

Method AddSectionFromFile

sdk/add_on/scriptbuilder/scriptbuilder.cpp:97–113  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

95// Returns 0 if the section was not included because it had already been included before
96// Returns <0 if there was an error
97int 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

Callers 5

GetControllerScriptMethod · 0.80
CompileScriptFunction · 0.80
CompileScriptFunction · 0.80
CompileScriptFunction · 0.80
TestExecuteScriptFunction · 0.80

Calls 1

GetAbsolutePathFunction · 0.85

Tested by 1

TestExecuteScriptFunction · 0.64