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
00037 class CL_SecurityDescriptor;
00038
00042 class CL_API_CORE CL_File : public CL_IODevice
00043 {
00046
00047 public:
00049
00050 enum AccessFlags
00051 {
00053 access_read = 1,
00054
00056 access_write = 2,
00057
00059 access_read_write = access_read | access_write
00060 };
00061
00063 enum ShareFlags
00064 {
00066 share_read = 1,
00067
00069 share_write = 2,
00070
00072 share_delete = 4,
00073
00075 share_all = share_read + share_write + share_delete
00076 };
00077
00079 enum OpenMode
00080 {
00082 open_always,
00083
00085 open_existing,
00086
00088 open_existing_truncate,
00089
00091 create_always,
00092
00094 create_new
00095 };
00096
00098 enum Flags
00099 {
00100 flag_write_through = 1,
00101 flag_no_buffering = 2,
00102 flag_random_access = 4,
00103 flag_sequential_scan = 8
00104 };
00105
00109
00110 public:
00112 CL_File();
00113
00117 CL_File(
00118 const CL_String &filename);
00119
00123 CL_File(
00124 const CL_String &filename,
00125 OpenMode mode,
00126 unsigned int access,
00127 unsigned int share = share_all,
00128 unsigned int flags = 0);
00129
00133 CL_File(
00134 const CL_String &filename,
00135 OpenMode mode,
00136 const CL_SecurityDescriptor &permissions,
00137 unsigned int access,
00138 unsigned int share = share_all,
00139 unsigned int flags = 0);
00140
00141 ~CL_File();
00142
00146
00147 public:
00149 CL_SecurityDescriptor get_permissions() const;
00150
00154
00155 public:
00159 bool open(
00160 const CL_String &filename);
00161
00165 bool open(
00166 const CL_String &filename,
00167 OpenMode mode,
00168 unsigned int access,
00169 unsigned int share = share_all,
00170 unsigned int flags = 0);
00171
00175 bool open(
00176 const CL_String &filename,
00177 OpenMode mode,
00178 const CL_SecurityDescriptor &permissions,
00179 unsigned int access,
00180 unsigned int share = share_all,
00181 unsigned int flags = 0);
00182
00184 void close();
00185
00187 bool set_permissions(const CL_SecurityDescriptor &permissions);
00188
00192
00193 private:
00195 };
00196