MCPcopy Create free account
hub / github.com/CytopiaTeam/Cytopia / AddSectionFromFile

Method AddSectionFromFile

external/as_add_on/scriptbuilder/scriptbuilder.cpp:94–110  ·  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

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

Callers 1

initMethod · 0.80

Calls 1

GetAbsolutePathFunction · 0.85

Tested by

no test coverage detected