mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
266 lines
22 KiB
ReStructuredText
266 lines
22 KiB
ReStructuredText
.. _class_File:
|
|
|
|
File
|
|
====
|
|
|
|
**Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`open_encrypted<class_File_open_encrypted>` **(** :ref:`String<class_string>` path, :ref:`int<class_int>` mode_flags, :ref:`RawArray<class_rawarray>` key **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`open_encrypted_with_pass<class_File_open_encrypted_with_pass>` **(** :ref:`String<class_string>` path, :ref:`int<class_int>` mode_flags, :ref:`String<class_string>` pass **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`open<class_File_open>` **(** :ref:`String<class_string>` path, :ref:`int<class_int>` flags **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`close<class_File_close>` **(** **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_open<class_File_is_open>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`seek<class_File_seek>` **(** :ref:`int<class_int>` pos **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`seek_end<class_File_seek_end>` **(** :ref:`int<class_int>` pos=0 **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_pos<class_File_get_pos>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_len<class_File_get_len>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`eof_reached<class_File_eof_reached>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_8<class_File_get_8>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_16<class_File_get_16>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_32<class_File_get_32>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_64<class_File_get_64>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_float<class_File_get_float>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_double<class_File_get_double>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_real<class_File_get_real>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RawArray<class_rawarray>` | :ref:`get_buffer<class_File_get_buffer>` **(** :ref:`int<class_int>` len **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_string>` | :ref:`get_line<class_File_get_line>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_string>` | :ref:`get_as_text<class_File_get_as_text>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_endian_swap<class_File_get_endian_swap>` **(** **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_endian_swap<class_File_set_endian_swap>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| Error | :ref:`get_error<class_File_get_error>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`get_var<class_File_get_var>` **(** **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`StringArray<class_stringarray>` | :ref:`get_csv_line<class_File_get_csv_line>` **(** :ref:`String<class_string>` delim="," **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_8<class_File_store_8>` **(** :ref:`int<class_int>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_16<class_File_store_16>` **(** :ref:`int<class_int>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_32<class_File_store_32>` **(** :ref:`int<class_int>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_64<class_File_store_64>` **(** :ref:`int<class_int>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_float<class_File_store_float>` **(** :ref:`float<class_float>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_double<class_File_store_double>` **(** :ref:`float<class_float>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_real<class_File_store_real>` **(** :ref:`float<class_float>` value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_buffer<class_File_store_buffer>` **(** :ref:`RawArray<class_rawarray>` buffer **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_line<class_File_store_line>` **(** :ref:`String<class_string>` line **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_string<class_File_store_string>` **(** :ref:`String<class_string>` string **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_var<class_File_store_var>` **(** var value **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`store_pascal_string<class_File_store_pascal_string>` **(** :ref:`String<class_string>` string **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_string>` | :ref:`get_pascal_string<class_File_get_pascal_string>` **(** **)** |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`file_exists<class_File_file_exists>` **(** :ref:`String<class_string>` path **)** const |
|
|
+----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Numeric Constants
|
|
-----------------
|
|
|
|
- **READ** = **1**
|
|
- **WRITE** = **2**
|
|
- **READ_WRITE** = **3**
|
|
- **WRITE_READ** = **7**
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_File_open_encrypted:
|
|
|
|
- :ref:`int<class_int>` **open_encrypted** **(** :ref:`String<class_string>` path, :ref:`int<class_int>` mode_flags, :ref:`RawArray<class_rawarray>` key **)**
|
|
|
|
.. _class_File_open_encrypted_with_pass:
|
|
|
|
- :ref:`int<class_int>` **open_encrypted_with_pass** **(** :ref:`String<class_string>` path, :ref:`int<class_int>` mode_flags, :ref:`String<class_string>` pass **)**
|
|
|
|
.. _class_File_open:
|
|
|
|
- :ref:`int<class_int>` **open** **(** :ref:`String<class_string>` path, :ref:`int<class_int>` flags **)**
|
|
|
|
.. _class_File_close:
|
|
|
|
- void **close** **(** **)**
|
|
|
|
.. _class_File_is_open:
|
|
|
|
- :ref:`bool<class_bool>` **is_open** **(** **)** const
|
|
|
|
.. _class_File_seek:
|
|
|
|
- void **seek** **(** :ref:`int<class_int>` pos **)**
|
|
|
|
.. _class_File_seek_end:
|
|
|
|
- void **seek_end** **(** :ref:`int<class_int>` pos=0 **)**
|
|
|
|
.. _class_File_get_pos:
|
|
|
|
- :ref:`int<class_int>` **get_pos** **(** **)** const
|
|
|
|
.. _class_File_get_len:
|
|
|
|
- :ref:`int<class_int>` **get_len** **(** **)** const
|
|
|
|
.. _class_File_eof_reached:
|
|
|
|
- :ref:`bool<class_bool>` **eof_reached** **(** **)** const
|
|
|
|
.. _class_File_get_8:
|
|
|
|
- :ref:`int<class_int>` **get_8** **(** **)** const
|
|
|
|
.. _class_File_get_16:
|
|
|
|
- :ref:`int<class_int>` **get_16** **(** **)** const
|
|
|
|
.. _class_File_get_32:
|
|
|
|
- :ref:`int<class_int>` **get_32** **(** **)** const
|
|
|
|
.. _class_File_get_64:
|
|
|
|
- :ref:`int<class_int>` **get_64** **(** **)** const
|
|
|
|
.. _class_File_get_float:
|
|
|
|
- :ref:`float<class_float>` **get_float** **(** **)** const
|
|
|
|
.. _class_File_get_double:
|
|
|
|
- :ref:`float<class_float>` **get_double** **(** **)** const
|
|
|
|
.. _class_File_get_real:
|
|
|
|
- :ref:`float<class_float>` **get_real** **(** **)** const
|
|
|
|
.. _class_File_get_buffer:
|
|
|
|
- :ref:`RawArray<class_rawarray>` **get_buffer** **(** :ref:`int<class_int>` len **)** const
|
|
|
|
.. _class_File_get_line:
|
|
|
|
- :ref:`String<class_string>` **get_line** **(** **)** const
|
|
|
|
.. _class_File_get_as_text:
|
|
|
|
- :ref:`String<class_string>` **get_as_text** **(** **)** const
|
|
|
|
.. _class_File_get_endian_swap:
|
|
|
|
- :ref:`bool<class_bool>` **get_endian_swap** **(** **)**
|
|
|
|
.. _class_File_set_endian_swap:
|
|
|
|
- void **set_endian_swap** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
.. _class_File_get_error:
|
|
|
|
- Error **get_error** **(** **)** const
|
|
|
|
.. _class_File_get_var:
|
|
|
|
- void **get_var** **(** **)** const
|
|
|
|
.. _class_File_get_csv_line:
|
|
|
|
- :ref:`StringArray<class_stringarray>` **get_csv_line** **(** :ref:`String<class_string>` delim="," **)** const
|
|
|
|
.. _class_File_store_8:
|
|
|
|
- void **store_8** **(** :ref:`int<class_int>` value **)**
|
|
|
|
.. _class_File_store_16:
|
|
|
|
- void **store_16** **(** :ref:`int<class_int>` value **)**
|
|
|
|
.. _class_File_store_32:
|
|
|
|
- void **store_32** **(** :ref:`int<class_int>` value **)**
|
|
|
|
.. _class_File_store_64:
|
|
|
|
- void **store_64** **(** :ref:`int<class_int>` value **)**
|
|
|
|
.. _class_File_store_float:
|
|
|
|
- void **store_float** **(** :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_File_store_double:
|
|
|
|
- void **store_double** **(** :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_File_store_real:
|
|
|
|
- void **store_real** **(** :ref:`float<class_float>` value **)**
|
|
|
|
.. _class_File_store_buffer:
|
|
|
|
- void **store_buffer** **(** :ref:`RawArray<class_rawarray>` buffer **)**
|
|
|
|
.. _class_File_store_line:
|
|
|
|
- void **store_line** **(** :ref:`String<class_string>` line **)**
|
|
|
|
.. _class_File_store_string:
|
|
|
|
- void **store_string** **(** :ref:`String<class_string>` string **)**
|
|
|
|
.. _class_File_store_var:
|
|
|
|
- void **store_var** **(** var value **)**
|
|
|
|
.. _class_File_store_pascal_string:
|
|
|
|
- void **store_pascal_string** **(** :ref:`String<class_string>` string **)**
|
|
|
|
.. _class_File_get_pascal_string:
|
|
|
|
- :ref:`String<class_string>` **get_pascal_string** **(** **)**
|
|
|
|
.. _class_File_file_exists:
|
|
|
|
- :ref:`bool<class_bool>` **file_exists** **(** :ref:`String<class_string>` path **)** const
|
|
|
|
|