Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_core.h"
00035 #include "iodevice.h"
00036 #include "../System/databuffer.h"
00037
00038 class CL_SecurityDescriptor;
00039
00043 class CL_API_CORE CL_File : public CL_IODevice
00044 {
00047 public:
00049 static CL_String read_text(const CL_String &filename);
00050
00052 static CL_DataBuffer read_bytes(const CL_String &filename);
00054
00057 public:
00059
00060 enum AccessFlags
00061 {
00063 access_read = 1,
00064
00066 access_write = 2,
00067
00069 access_read_write = access_read | access_write
00070 };
00071
00073 enum ShareFlags
00074 {
00076 share_read = 1,
00077
00079 share_write = 2,
00080
00082 share_delete = 4,
00083
00085 share_all = share_read + share_write + share_delete
00086 };
00087
00089 enum OpenMode
00090 {
00092 open_always,
00093
00095 open_existing,
00096
00098 open_existing_truncate,
00099
00101 create_always,
00102
00104 create_new
00105 };
00106
00108 enum Flags
00109 {
00110 flag_write_through = 1,
00111 flag_no_buffering = 2,
00112 flag_random_access = 4,
00113 flag_sequential_scan = 8
00114 };
00115
00119
00120 public:
00122 CL_File();
00123
00127 CL_File(
00128 const CL_String &filename);
00129
00133 CL_File(
00134 const CL_String &filename,
00135 OpenMode mode,
00136 unsigned int access,
00137 unsigned int share = share_all,
00138 unsigned int flags = 0);
00139
00143 CL_File(
00144 const CL_String &filename,
00145 OpenMode mode,
00146 const CL_SecurityDescriptor &permissions,
00147 unsigned int access,
00148 unsigned int share = share_all,
00149 unsigned int flags = 0);
00150
00151 ~CL_File();
00152
00156
00157 public:
00159 CL_SecurityDescriptor get_permissions() const;
00160
00164
00165 public:
00169 bool open(
00170 const CL_String &filename);
00171
00175 bool open(
00176 const CL_String &filename,
00177 OpenMode mode,
00178 unsigned int access,
00179 unsigned int share = share_all,
00180 unsigned int flags = 0);
00181
00185 bool open(
00186 const CL_String &filename,
00187 OpenMode mode,
00188 const CL_SecurityDescriptor &permissions,
00189 unsigned int access,
00190 unsigned int share = share_all,
00191 unsigned int flags = 0);
00192
00194 void close();
00195
00197 bool set_permissions(const CL_SecurityDescriptor &permissions);
00198
00202
00203 private:
00205 };
00206