4#include <system/date_time.h>
5#include <system/collections/ienumerable.h>
6#include <system/text/encoding.h>
7#include <system/io/file_stream.h>
8#include <system/io/stream_writer.h>
9#include <system/io/stream_reader.h>
10#include <system/io/file_attributes.h>
11#include <system/io/path.h>
13namespace System {
namespace IO {
49 static ASPOSECPP_SHARED_API
void Copy(
const String& sourceFileName,
const String& destFileName,
bool overwrite =
false);
108 static ASPOSECPP_SHARED_API
void Move(
const String& sourceFileName,
const String& destFileName);
163 static ASPOSECPP_SHARED_API
void Replace(
const String& sourceFileName,
const String& destinationFileName,
const String& destinationBackupFileName,
bool ignoreMetadataErrors =
true);
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Contains methods for manipulating directories. This is a static type with no instance services....
Definition: directory.h:58
Provides methods for manipulating files. This is a static type with no instance services....
Definition: file.h:18
static DateTime GetLastAccessTimeUtc(const String &path)
Returns the last access time of the specified entity as UTC time.
static void SetCreationTime(const String &path, DateTime creationTime)
NOT IMPLEMENTED.
static void Move(const String &sourceFileName, const String &destFileName)
Moves the specified file to the new location.
static FileAttributes GetAttributes(const String &path)
Returns the attributes of the specified entity.
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.
static DateTime GetLastWriteTime(const String &path)
Returns the last write time of the specified entity as local time.
static void SetLastAccessTimeUtc(const String &path, DateTime lastWriteTimeUtc)
NOT IMPLEMENTED.
static void WriteAllBytes(const String &path, const ArrayPtr< uint8_t > &bytes)
Overwrites the specified binary file and writes the specified bytes to it.
static void Decrypt(const String &path)
NOT IMPLEMENTED.
static void SetLastWriteTimeUtc(const String &path, DateTime lastWriteTimeUtc)
Sets the last write time of the specified entity as UTC time.
static const int32_t DefaultBufferSize
Default value of the number of bytes buffered during reading from and writing to a file.
Definition: file.h:23
static StreamWriterPtr CreateText(const String &path)
Creates a new or opens existing file for writing UTF-8 encoded text.
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.
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 ...
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 spe...
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 ...
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 arra...
static void SetLastWriteTime(const String &path, DateTime lastWriteTime)
Sets the last write time of the specified entity as local time.
static void SetAttributes(const String &path, FileAttributes fileAttributes)
Sets the specified attributes on the specified file.
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,...
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 enum...
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.
static StreamWriterPtr AppendText(const String &path)
Creates a StreamWriter object that appends text to the specified file using UTF-8 encoding....
static DateTime GetCreationTime(const String &path)
Returns the creation time of the specified entity as local time.
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 ...
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...
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 en...
static DateTime GetCreationTimeUtc(const String &path)
Returns the creation time of the specified entity as UTC time.
static DateTime GetLastWriteTimeUtc(const String &path)
Returns the last write time of the specified entity as UTC time.
static DateTime GetLastAccessTime(const String &path)
Returns the last access time of the specified entity as local time.
static void Encrypt(const String &path)
NOT IMPLEMENTED.
static ArrayPtr< uint8_t > ReadAllBytes(const String &path)
Reads the content of the specified binary file to a byte array.
static void SetLastAccessTime(const String &path, DateTime lastWriteTime)
NOT IMPLEMENTED.
static FileStreamPtr OpenRead(const String &path)
Opens the specified file for reading only, in 'Open' mode with shared access for reading.
static FileStreamPtr Open(const String &path, FileMode mode)
Opens the specified file in the specified mode for reading and writing and with no sharing.
static FileStreamPtr OpenWrite(const String &path)
Opens the specified file for writing only, in 'OpenOrCreate' mode with no sharing.
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.
static void Delete(const String &path)
Deletes the specified file or directory.
static void SetCreationTimeUtc(const String &path, DateTime creationTimeUtc)
NOT IMPLEMENTED.
static bool Exists(const String &path)
Determines if the specified path references an existing file.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
static EncodingPtr get_UTF8Unmarked()
Only internal, to be used by the class libraries: Unmarked and non-input-validating.
static EncodingPtr get_UTF8()
Gets the standard UTF-8 encoding object.
FileOptions
Represents advanced options for creating FileStream object.
Definition: file_options.h:12
@ None
No additional options.
FileAccess
Specifies the type of access when opening the file.
Definition: file_access.h:11
FileShare
Specifies what kind of access other FileStream objects can have to a file being opened.
Definition: file_share.h:11
FileMode
Specifies how a file should be opened.
Definition: file_mode.h:10
FileAttributes
Represents attributes of a directory or a file.
Definition: file_attributes.h:9
Definition: db_command.h:9