Load text file in AngelScript

Can I load .txt file in AngelScript (to string) ?
Somehow using resource cache (there are xml and json but I need .txt loader) ?

  1. Create and open file:
    File@ file = File();
    file.Open(“full path to Your txt file”, FILE_READ);
    or just:
    File@ file = File("full path to Your txt file, FILE_READ);

  2. Read String:
    String s = file.ReadString();
    or:
    String s = file.ReadLine();

1 Like