MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / das_fileaccess_introduce_file

Function das_fileaccess_introduce_file

src/misc/daScriptC.cpp:192–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void das_fileaccess_introduce_file ( das_file_access * access, const char * file_name, const char * file_content, int owns ) {
193 auto len = uint32_t(strlen(file_content));
194 if ( owns ) {
195 char * content_copy = (char *) das_aligned_alloc16(len ? len : 1);
196 memcpy(content_copy, file_content, len);
197 auto fileInfo = make_unique<TextFileInfo>(content_copy, len, true);
198 ((FileAccess *) access)->setFileInfo(file_name, das::move(fileInfo));
199 } else {
200 auto fileInfo = make_unique<TextFileInfo>((char *) file_content, len, false);
201 ((FileAccess *) access)->setFileInfo(file_name, das::move(fileInfo));
202 }
203}
204
205void das_fileaccess_introduce_file_from_disk ( das_file_access * access, const char * name, const char * disk_path ) {
206 ((FsFileAccess *) access)->introduceFileFromDisk(name, disk_path);

Callers 10

compile_inlineFunction · 0.85
compile_inlineFunction · 0.85
compile_inlineFunction · 0.85
part1_problemFunction · 0.85
part2_solutionFunction · 0.85
run_inline_scriptFunction · 0.85
run_valid_scriptFunction · 0.85
compile_and_reportFunction · 0.85
compile_with_policiesFunction · 0.85

Calls 2

das_aligned_alloc16Function · 0.85
setFileInfoMethod · 0.80

Tested by 3

compile_inlineFunction · 0.68
compile_inlineFunction · 0.68
compile_inlineFunction · 0.68