From def5c50960eea4c112647f88361a3ae7155901a8 Mon Sep 17 00:00:00 2001 From: egor-tensin Date: Tue, 4 Jul 2023 00:48:00 +0000 Subject: =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20egor-tensin/wina?= =?UTF-8?q?pi-common@0c196cbe8b4927c78c02b2c7312fc69a507db845=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classwinapi_1_1File.html | 495 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 495 insertions(+) create mode 100644 classwinapi_1_1File.html (limited to 'classwinapi_1_1File.html') diff --git a/classwinapi_1_1File.html b/classwinapi_1_1File.html new file mode 100644 index 0000000..49e9415 --- /dev/null +++ b/classwinapi_1_1File.html @@ -0,0 +1,495 @@ + + + + + + + +winapi_common: winapi::File Class Reference + + + + + + + + + +
+
+ + + + + + +
+
winapi_common +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
winapi::File Class Reference
+
+
+ +

File I/O. + More...

+
+Inheritance diagram for winapi::File:
+
+
+ + +winapi::Handle + +
+ + + + +

+Classes

struct  ID
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 File (Handle &&handle)
 
std::size_t get_size () const
 
ID query_id () const
 
- Public Member Functions inherited from winapi::Handle
Handle (HANDLE)
 
+HANDLE get () const
 
+HANDLE ptr () const
 
operator HANDLE () const
 
+bool is_valid () const
 
void close ()
 
bool is_std () const
 
Buffer read () const
 
bool read_chunk (Buffer &read_chunk) const
 
void write (const void *data, std::size_t nb) const
 
void write (const Buffer &buffer) const
 
template<typename CharT >
void write (const std::basic_string< CharT > &src) const
 
+void inherit (bool yes=true) const
 
+void dont_inherit () const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static File open_r (const std::string &)
 
static File open_r (const CanonicalPath &)
 
static File open_read_attributes (const std::string &)
 
static File open_read_attributes (const CanonicalPath &)
 
static File open_w (const std::string &)
 
static File open_w (const CanonicalPath &)
 
static void remove (const std::string &)
 
static void remove (const CanonicalPath &)
 
- Static Public Member Functions inherited from winapi::Handle
+static bool is_valid (HANDLE)
 
static Handle std_in ()
 
static Handle std_out ()
 
static Handle std_err ()
 
+ + + + +

+Additional Inherited Members

- Static Public Attributes inherited from winapi::Handle
+static constexpr std::size_t max_chunk_size = 16 * 1024
 
+

Detailed Description

+

File I/O.

+

Easily open, read & write files.

+ +

Definition at line 29 of file file.hpp.

+

Constructor & Destructor Documentation

+ +

◆ File()

+ +
+
+ + + + + +
+ + + + + + + + +
winapi::File::File (Handle && handle)
+
+inlineexplicit
+
+

Make a File instance from an open handle.

+ +

Definition at line 59 of file file.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ open_r() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_r (const std::string & path)
+
+static
+
+

Open file for reading.

+ +

Definition at line 92 of file file.cpp.

+ +
+
+ +

◆ open_r() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_r (const CanonicalPathpath)
+
+static
+
+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ +

Definition at line 96 of file file.cpp.

+ +
+
+ +

◆ open_read_attributes() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_read_attributes (const std::string & path)
+
+static
+
+

Open file for reading (inc. ability to read its attributes).

+ +

Definition at line 100 of file file.cpp.

+ +
+
+ +

◆ open_read_attributes() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_read_attributes (const CanonicalPathpath)
+
+static
+
+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ +

Definition at line 104 of file file.cpp.

+ +
+
+ +

◆ open_w() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_w (const std::string & path)
+
+static
+
+

Open file for writing.

+ +

Definition at line 108 of file file.cpp.

+ +
+
+ +

◆ open_w() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
File winapi::File::open_w (const CanonicalPathpath)
+
+static
+
+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ +

Definition at line 112 of file file.cpp.

+ +
+
+ +

◆ remove() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
void winapi::File::remove (const std::string & path)
+
+static
+
+

Delete a file.

+ +

Definition at line 116 of file file.cpp.

+ +
+
+ +

◆ remove() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
void winapi::File::remove (const CanonicalPathpath)
+
+static
+
+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ +

Definition at line 120 of file file.cpp.

+ +
+
+ +

◆ get_size()

+ +
+
+ + + + + + + +
std::size_t winapi::File::get_size () const
+
+

Get file size.

Returns
File size, bytes.
+ +

Definition at line 124 of file file.cpp.

+ +
+
+ +

◆ query_id()

+ +
+
+ + + + + + + +
File::ID winapi::File::query_id () const
+
+

Get file ID. File ID is a unique representation of a file, suitable for hashing.

+ +

Definition at line 139 of file file.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + -- cgit v1.2.3