file.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
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 

Generated on Thu Dec 3 02:39:29 2009 for ClanLib by  doxygen 1.4.6