initial framework added
[fp1415-soccerfun.git] / src / StdLibExt / fileIO.dcl
1 definition module fileIO
2
3 /** Collection of functions that extend functionality of StdFile.
4 */
5
6 import StdBitmap
7
8 /** getImage path env
9 expects a bitmap file at path. If this is not the case, the function
10 aborts. Otherwise, it returns the bitmap.
11 */
12 getImage :: !String !*env -> (!Bitmap,!*env) | FileSystem env
13
14 /** writeFile appendData path content env
15 writes content to a currently closed file, located at path, and closes it again.
16 It appends content to current content in case of appendData, and replaces content otherwise.
17 The function aborts in case of incorrect path and failing to close the file.
18 */
19 writeFile :: !Bool !String !String !*env -> *env | FileSystem env
20
21 /** readFile path env
22 reads the current content of the file located at path as a text file and closes it.
23 The function yields Nothing in case of incorrect path and failing to close the file
24 and (Just content) otherwise.
25 */
26 readFile :: !String !*env -> (!Maybe String,*env) | FileSystem env