CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
|
Provides methods for manipulating files. This is a static type with no instance services. You should never create instances of it by any means. More...
#include <file.h>
Static Public Member Functions | |
static void | AppendAllLines (const String &path, const SharedPtr< Collections::Generic::IEnumerable< String > > &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Appends strings from the specified collection of strings to the specified file using the specified encoding by writing each string in a new line. If the specified file does not exist, it is created. The file is closed after writing all strings. More... | |
static void | AppendAllText (const String &path, const String &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Appends the specified string to the specified file using the specified encoding. More... | |
static StreamWriterPtr | AppendText (const String &path) |
Creates a StreamWriter object that appends text to the specified file using UTF-8 encoding. If the specified file does not exist, it is created. More... | |
static void | Copy (const String &sourceFileName, const String &destFileName, bool overwrite=false) |
Copies the specified file to the specified location. If the destination file already exists, a parameter specifies if it should be overwritten. More... | |
static FileStreamPtr | Create (const String &path, int32_t bufferSize=DefaultBufferSize, FileOptions options=FileOptions::None) |
Creates a new file (or overwrites existing) and opens it for reading and writing access using the specified buffer size and options. More... | |
static StreamWriterPtr | CreateText (const String &path) |
Creates a new or opens existing file for writing UTF-8 encoded text. More... | |
static void | Decrypt (const String &path) |
NOT IMPLEMENTED. More... | |
static void | Delete (const String &path) |
Deletes the specified file or directory. More... | |
static void | Encrypt (const String &path) |
NOT IMPLEMENTED. More... | |
static bool | Exists (const String &path) |
Determines if the specified path references an existing file. More... | |
static FileAttributes | GetAttributes (const String &path) |
Returns the attributes of the specified entity. More... | |
static DateTime | GetCreationTime (const String &path) |
Returns the creation time of the specified entity as local time. More... | |
static DateTime | GetCreationTimeUtc (const String &path) |
Returns the creation time of the specified entity as UTC time. More... | |
static DateTime | GetLastAccessTime (const String &path) |
Returns the last access time of the specified entity as local time. More... | |
static DateTime | GetLastAccessTimeUtc (const String &path) |
Returns the last access time of the specified entity as UTC time. More... | |
static DateTime | GetLastWriteTime (const String &path) |
Returns the last write time of the specified entity as local time. More... | |
static DateTime | GetLastWriteTimeUtc (const String &path) |
Returns the last write time of the specified entity as UTC time. More... | |
static void | Move (const String &sourceFileName, const String &destFileName) |
Moves the specified file to the new location. More... | |
static FileStreamPtr | Open (const String &path, FileMode mode) |
Opens the specified file in the specified mode for reading and writing and with no sharing. More... | |
static FileStreamPtr | Open (const String &path, FileMode mode, FileAccess access, FileShare share=FileShare::None) |
Opens the specified file in the specified mode, with the specified access type and sharing option. More... | |
static FileStreamPtr | OpenRead (const String &path) |
Opens the specified file for reading only, in 'Open' mode with shared access for reading. More... | |
static StreamReaderPtr | OpenText (const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Opens the specified existing file for reading text using UTF-8 encoding with no sharing. More... | |
static FileStreamPtr | OpenWrite (const String &path) |
Opens the specified file for writing only, in 'OpenOrCreate' mode with no sharing. More... | |
static ArrayPtr< uint8_t > | ReadAllBytes (const String &path) |
Reads the content of the specified binary file to a byte array. More... | |
static ArrayPtr< String > | ReadAllLines (const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8()) |
Reads the content of the specified text file line by line to an array of strings using the specified character encoding. More... | |
static String | ReadAllText (const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8()) |
Reads the content of the specified text file to a single String object using the specified character encoding. More... | |
static SharedPtr< Collections::Generic::IEnumerable< String > > | ReadLines (const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8()) |
Reads the content of the specified text file line by line using the specified character encoding and returns enumerable collection of strings each of which represents a single line of the file's content. More... | |
static void | Replace (const String &sourceFileName, const String &destinationFileName, const String &destinationBackupFileName, bool ignoreMetadataErrors=true) |
Replaces the contents of a one file with another and creates a backup of the replaced file. More... | |
static void | SetAttributes (const String &path, FileAttributes fileAttributes) |
Sets the specified attributes on the specified file. More... | |
static void | SetCreationTime (const String &path, DateTime creationTime) |
NOT IMPLEMENTED. More... | |
static void | SetCreationTimeUtc (const String &path, DateTime creationTimeUtc) |
NOT IMPLEMENTED. More... | |
static void | SetLastWriteTime (const String &path, DateTime lastWriteTime) |
Sets the last write time of the specified entity as local time. More... | |
static void | SetLastWriteTimeUtc (const String &path, DateTime lastWriteTimeUtc) |
Sets the last write time of the specified entity as UTC time. More... | |
static void | SetLastAccessTime (const String &path, DateTime lastWriteTime) |
NOT IMPLEMENTED. More... | |
static void | SetLastAccessTimeUtc (const String &path, DateTime lastWriteTimeUtc) |
NOT IMPLEMENTED. More... | |
static void | WriteAllBytes (const String &path, const ArrayPtr< uint8_t > &bytes) |
Overwrites the specified binary file and writes the specified bytes to it. More... | |
static void | WriteAllLines (const String &path, const SharedPtr< Collections::Generic::IEnumerable< String > > &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Creates a new text file or overwrites the existing one and writes all strings from the specified enumerable collection of strings to it, each string on a new line, using the specified encoding. More... | |
static void | WriteAllLines (const String &path, const ArrayPtr< String > &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Creates a new text file or overwrites the existing one and writes all strings from the specified array of strings to it, each string on a new line, using the specified encoding. More... | |
static void | WriteAllText (const String &path, const String &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked()) |
Creates a new text file or overwrites the existing one and writes the content of the specified string to it using the specified encoding. More... | |
Static Public Attributes | |
static const int32_t | DefaultBufferSize |
Default value of the number of bytes buffered during reading from and writing to a file. More... | |
Provides methods for manipulating files. This is a static type with no instance services. You should never create instances of it by any means.
|
static |
Appends strings from the specified collection of strings to the specified file using the specified encoding by writing each string in a new line. If the specified file does not exist, it is created. The file is closed after writing all strings.
path | The path of the file to append the strings to |
contents | The strings to write to the file |
encoding | The character encoding to use |
|
static |
Appends the specified string to the specified file using the specified encoding.
path | The path of the file to append the string to |
contents | The string to write to the file |
encoding | The character encoding to use |
|
static |
Creates a StreamWriter object that appends text to the specified file using UTF-8 encoding. If the specified file does not exist, it is created.
path | The path of the file to open or create |
|
static |
Copies the specified file to the specified location. If the destination file already exists, a parameter specifies if it should be overwritten.
sourceFileName | A path of the file to copy |
destFileName | A path of the new location of the file to copy |
overwrite | True if the existing destination file should be overwritten, false if copying should fail if the destination file already exists |
|
static |
Creates a new file (or overwrites existing) and opens it for reading and writing access using the specified buffer size and options.
path | The path of the file to create or overwrite |
bufferSize | The number of bytes buffered when reading from and writing to the file |
options | Specifies how to create or overwrite the file |
|
static |
Creates a new or opens existing file for writing UTF-8 encoded text.
path | The path of the file to create or open |
|
static |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
Deletes the specified file or directory.
path | The path of the file or directory to delete |
|
static |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
Determines if the specified path references an existing file.
path | The path to test |
path
references an existing file, otherwise - false
|
static |
Returns the attributes of the specified entity.
path | The path of the entity whose attributes to return |
path
Returns the creation time of the specified entity as local time.
path | The entity whose creating time to retrieve |
Returns the creation time of the specified entity as UTC time.
path | The entity whose creating time to retrieve |
Returns the last access time of the specified entity as local time.
path | The entity whose last access time to retrieve |
Returns the last access time of the specified entity as UTC time.
path | The entity whose last access time to retrieve |
Returns the last write time of the specified entity as local time.
path | The entity whose last write time to retrieve |
Returns the last write time of the specified entity as UTC time.
path | The entity whose last write time to retrieve |
|
static |
Moves the specified file to the new location.
sourceFileName | A file to move |
destFileName | The new location of a file referenced by sourceFileName |
|
static |
Opens the specified file in the specified mode for reading and writing and with no sharing.
path | The path of the file to open |
mode | Specifies the mode in which to open the file |
|
static |
Opens the specified file in the specified mode, with the specified access type and sharing option.
path | The path of the file to open |
mode | Specifies the mode in which to open the file |
access | The requested access type |
share | The type of access that other FileStream objects have to the opened file |
|
static |
Opens the specified file for reading only, in 'Open' mode with shared access for reading.
path | The path of the file to open |
|
static |
Opens the specified existing file for reading text using UTF-8 encoding with no sharing.
path | The path of the file to open |
encoding | The character encoding to use |
|
static |
Opens the specified file for writing only, in 'OpenOrCreate' mode with no sharing.
path | The path of the file to open |
Reads the content of the specified binary file to a byte array.
path | The path of the file to read |
|
static |
Reads the content of the specified text file line by line to an array of strings using the specified character encoding.
path | The path of the file to read |
encoding | The character encoding to use |
|
static |
Reads the content of the specified text file to a single String object using the specified character encoding.
path | The path of the file to read |
encoding | The character encoding to use |
|
static |
Reads the content of the specified text file line by line using the specified character encoding and returns enumerable collection of strings each of which represents a single line of the file's content.
path | The path of the file to read |
encoding | The character encoding to use |
|
static |
Replaces the contents of a one file with another and creates a backup of the replaced file.
sourceFileName | A name of the file to replace with |
destinationFileName | A name of the file to replace |
destinationBackupFileName | A name of the backup file |
ignoreMetadataErrors | Specifies if the merge errors from the replaced file to the replacement file should be ignored (true) or not (false) |
|
static |
Sets the specified attributes on the specified file.
path | The path of the file on which the attributes to be set |
fileAttributes | A bitwise combination of FileAttributes values representing the attributes to set |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
NOT IMPLEMENTED.
NotImplementedException | Always |
|
static |
Sets the last write time of the specified entity as local time.
path | The entity whose last write time to set |
lastWriteTime | A DateTime object representing the time to set as local time |
|
static |
Sets the last write time of the specified entity as UTC time.
path | The entity whose last write time to set |
lastWriteTimeUtc | A DateTime object representing the time to set as UTC time |
|
static |
Overwrites the specified binary file and writes the specified bytes to it.
path | The file to write to |
bytes | The byte array containing the bytes to write to the specified file |
|
static |
Creates a new text file or overwrites the existing one and writes all strings from the specified array of strings to it, each string on a new line, using the specified encoding.
path | The file to create or overwrite |
contents | A string array |
encoding | The character encoding to use |
|
static |
Creates a new text file or overwrites the existing one and writes all strings from the specified enumerable collection of strings to it, each string on a new line, using the specified encoding.
path | The file to create or overwrite |
contents | An enumerable collection of strings |
encoding | The character encoding to use |
|
static |
Creates a new text file or overwrites the existing one and writes the content of the specified string to it using the specified encoding.
path | The file to create or overwrite |
contents | A string array |
encoding | The character encoding to use |
|
static |
Default value of the number of bytes buffered during reading from and writing to a file.