summaryrefslogtreecommitdiff
path: root/cosv/inc/cosv/openclose.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'cosv/inc/cosv/openclose.hxx')
-rw-r--r--cosv/inc/cosv/openclose.hxx52
1 files changed, 26 insertions, 26 deletions
diff --git a/cosv/inc/cosv/openclose.hxx b/cosv/inc/cosv/openclose.hxx
index b4f952ed2c67..ad1e906388b9 100644
--- a/cosv/inc/cosv/openclose.hxx
+++ b/cosv/inc/cosv/openclose.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,32 +36,32 @@ namespace csv
// Open modes for storages:
enum E_RWMode
{
- rwDefault = 0x0000, // Keep old settings. If there are none, set default.
- rwRead = 0x0001, // Reads only
- rwWrite = 0x0002, // Writes only
- rwReadWrite = 0x0003 // Reads and writes.
+ rwDefault = 0x0000, // Keep old settings. If there are none, set default.
+ rwRead = 0x0001, // Reads only
+ rwWrite = 0x0002, // Writes only
+ rwReadWrite = 0x0003 // Reads and writes.
};
enum E_OpenMode
{
- omCreateIfNecessary = 0x0000, // Creates a new file only, if file does not exist.
- omCreateNot = 0x0010, // Open fails, if file does not exist.
- omCreate = 0x0020 // Existing file will be deleted.
+ omCreateIfNecessary = 0x0000, // Creates a new file only, if file does not exist.
+ omCreateNot = 0x0010, // Open fails, if file does not exist.
+ omCreate = 0x0020 // Existing file will be deleted.
};
enum E_ShareMode
{
- shmShareNot = 0x0000, // Allow others nothing
- shmShareRead = 0x0004, // Allow others to read
- shmShareAll = 0x000C // Allow others to read and write
+ shmShareNot = 0x0000, // Allow others nothing
+ shmShareRead = 0x0004, // Allow others to read
+ shmShareAll = 0x000C // Allow others to read and write
};
/** Constants for filemode combinations
These combinations are the only ones, guaranteed to be supported.
*/
-const UINT32 CFM_RW = rwReadWrite;
-const UINT32 CFM_CREATE =
+const UINT32 CFM_RW = rwReadWrite;
+const UINT32 CFM_CREATE =
static_cast< UINT32 >(rwReadWrite) | static_cast< UINT32 >(omCreate);
-const UINT32 CFM_READ =
+const UINT32 CFM_READ =
static_cast< UINT32 >(rwRead) | static_cast< UINT32 >(omCreateNot) |
static_cast< UINT32 >(shmShareRead);
@@ -72,16 +72,16 @@ class OpenClose
public:
virtual ~OpenClose() {}
- bool open(
- UINT32 in_nOpenModeInfo = 0 ); /// Combination of values of E_RWMode and E_ShareMode und E_OpenMode. 0 := Keep existing mode.
- void close();
+ bool open(
+ UINT32 in_nOpenModeInfo = 0 ); /// Combination of values of E_RWMode and E_ShareMode und E_OpenMode. 0 := Keep existing mode.
+ void close();
bool is_open() const;
private:
- virtual bool do_open(
- UINT32 in_nOpenModeInfo ) = 0;
- virtual void do_close() = 0;
+ virtual bool do_open(
+ UINT32 in_nOpenModeInfo ) = 0;
+ virtual void do_close() = 0;
virtual bool inq_is_open() const = 0;
};
@@ -91,8 +91,8 @@ class OpenCloseGuard
{
public:
OpenCloseGuard(
- OpenClose & i_rOpenClose,
- UINT32 i_nOpenModeInfo = 0 );
+ OpenClose & i_rOpenClose,
+ UINT32 i_nOpenModeInfo = 0 );
~OpenCloseGuard();
operator bool() const;
@@ -102,7 +102,7 @@ class OpenCloseGuard
OpenCloseGuard & operator=(OpenCloseGuard&);
// DATA
- OpenClose & rOpenClose;
+ OpenClose & rOpenClose;
};
@@ -119,9 +119,9 @@ OpenClose::is_open() const
{ return inq_is_open(); }
inline
-OpenCloseGuard::OpenCloseGuard( OpenClose & i_rOpenClose,
- UINT32 i_nOpenModeInfo )
- : rOpenClose(i_rOpenClose)
+OpenCloseGuard::OpenCloseGuard( OpenClose & i_rOpenClose,
+ UINT32 i_nOpenModeInfo )
+ : rOpenClose(i_rOpenClose)
{ rOpenClose.open(i_nOpenModeInfo); }
inline
OpenCloseGuard::~OpenCloseGuard()