Difference between revisions of "HOWTO-Open Files"

Jump to navigation Jump to search
36 bytes added ,  15:17, 25 October 2018
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (Mention that also ARJ files can be accessed as Archive's.)
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:


The basic case: you want to open a file called "datafile.dat":
The basic case: you want to open a file called "datafile.dat":
<syntax type="C++">
<syntaxhighlight lang="cpp">
#include "common/file.h"
#include "common/file.h"


Line 17: Line 17:
}
}
// access f
// access f
</syntax>
</syntaxhighlight>


Or, you want to open a file called "datafile.dat" in a subdirectory "data" of the game directory:
Or, you want to open a file called "datafile.dat" in a subdirectory "data" of the game directory:
<syntax type="C++">
<syntaxhighlight lang="cpp">
#include "common/file.h"
#include "common/file.h"


Line 28: Line 28:
}
}
// access f
// access f
</syntax>
</syntaxhighlight>


This functions by searching through a default search path managed by the SearchManager (short: SearchMan).
This functions by searching through a default search path managed by the SearchManager (short: SearchMan).
TrustedUser
2,147

edits

Navigation menu