CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
file_info.h
1
2#ifndef _file_info_h_
3#define _file_info_h_
4
5#include "fwd.h"
6#include "system/io/file_system_info.h"
7#include "system/io/directory_info.h"
8
9namespace System { namespace IO {
14 class ASPOSECPP_SHARED_CLASS FileInfo : public FileSystemInfo {
15 public:
18 ASPOSECPP_SHARED_API FileInfo(const String& path);
19
20 //***** Properties
23 ASPOSECPP_SHARED_API DirectoryInfoPtr get_Directory();
26 ASPOSECPP_SHARED_API String get_DirectoryName();
29 ASPOSECPP_SHARED_API bool get_IsReadOnly();
32 ASPOSECPP_SHARED_API void set_IsReadOnly(bool value);
34 ASPOSECPP_SHARED_API int64_t get_Length();
36 virtual ASPOSECPP_SHARED_API bool get_Exists() override;
38 virtual ASPOSECPP_SHARED_API String get_Name() override;
39
40 //***** Methods
45 ASPOSECPP_SHARED_API FileInfoPtr CopyTo(const String& destFileName);
52 ASPOSECPP_SHARED_API FileInfoPtr CopyTo(const String& destFileName, bool overwrite);
53
55 virtual ASPOSECPP_SHARED_API void Delete() override;
60 ASPOSECPP_SHARED_API FileInfoPtr Replace(const String& destinationFileName, const String& destinationBackupFileName);
66 ASPOSECPP_SHARED_API FileInfoPtr Replace(const String& destinationFileName, const String& destinationBackupFileName, bool ignoreMetadataErrors);
67
70 ASPOSECPP_SHARED_API void Decrypt();
73 ASPOSECPP_SHARED_API void Encrypt();
76 ASPOSECPP_SHARED_API void MoveTo(const String& destFileName);
77
81 ASPOSECPP_SHARED_API FileStreamPtr Open(FileMode mode);
86 ASPOSECPP_SHARED_API FileStreamPtr Open(FileMode mode, FileAccess access);
92 ASPOSECPP_SHARED_API FileStreamPtr Open(FileMode mode, FileAccess access, FileShare share);
93
97 ASPOSECPP_SHARED_API FileStreamPtr Create();
100 ASPOSECPP_SHARED_API FileStreamPtr OpenRead();
103 ASPOSECPP_SHARED_API FileStreamPtr OpenWrite();
104
107 ASPOSECPP_SHARED_API StreamWriterPtr AppendText();
111 ASPOSECPP_SHARED_API StreamWriterPtr CreateText();
115 ASPOSECPP_SHARED_API StreamReaderPtr OpenText();
116
118 ASPOSECPP_SHARED_API String ToString() const override;
119
120 };
121
122}}
123
124#endif // _file_info_h_
125
Represents a path to a file and a file referred to by this path and provides methods for manipulating...
Definition: file_info.h:14
FileInfoPtr CopyTo(const String &destFileName, bool overwrite)
Copies the file represented by the current object to the specified location. A parameter specifies if...
FileStreamPtr Open(FileMode mode)
Opens the file represented by the current object in the specified mode for reading and writing and wi...
FileInfo(const String &path)
Constructs a new instance of FileInfo class that represents the specified file.
virtual void Delete() override
Removes the file represented by the current object.
virtual bool get_Exists() override
Returns a value that indicates if the file exists.
FileStreamPtr Open(FileMode mode, FileAccess access, FileShare share)
Opens the file represented by the current object in the specified mode, with the specified access typ...
StreamWriterPtr AppendText()
Opens a file represented by the current object for writing text using UTF-8 encoding,...
StreamReaderPtr OpenText()
Opens the existing file at the location specified by the path represented by the current object for r...
void MoveTo(const String &destFileName)
Moves the file represented by the current object to the specified location.
StreamWriterPtr CreateText()
Creates a file at the location specified by the path represented by the current object and opens it f...
FileStreamPtr OpenRead()
Opens a file represented by the current object for reading only, in 'Open' mode with shared access fo...
String get_DirectoryName()
Returns the full name of the directory in which the file represented by the current object is loctaed...
FileInfoPtr CopyTo(const String &destFileName)
Copies the file represented by the current object to the specified location. If the destination file ...
virtual String get_Name() override
Returns the name of the file.
void Decrypt()
NOT IMPLEMENTED.
FileStreamPtr Open(FileMode mode, FileAccess access)
Opens the file represented by the current object in the specified mode, with the specified access typ...
void set_IsReadOnly(bool value)
Sets or unsets the ReadOnly attribute on the file.
FileStreamPtr Create()
Creates a file at the location specified by the path represented by the current object and opens it f...
void Encrypt()
NOT IMPLEMENTED.
bool get_IsReadOnly()
Returns a value that indicates if the ReadOnly attribute is set.
FileInfoPtr Replace(const String &destinationFileName, const String &destinationBackupFileName, bool ignoreMetadataErrors)
Replaces the contents of a specified destination file with the file represented by the current FileIn...
FileInfoPtr Replace(const String &destinationFileName, const String &destinationBackupFileName)
Replaces the contents of a specified destination file with the file represented by the current FileIn...
DirectoryInfoPtr get_Directory()
Returns a DirectoryInfo object that represents a directory in which the file represented by the curre...
FileStreamPtr OpenWrite()
Opens a file represented by the current object for writing only, in 'OpenOrCreate' mode with no shari...
int64_t get_Length()
Returns the size of the file in bytes.
String ToString() const override
Returns a path represented by the current object.
The base class for FileInfo and DirectoryInfo. Objects of this class should only be allocated using S...
Definition: file_system_info.h:31
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
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
Definition: db_command.h:9