OpenZWave Library 1.6.1914
FileOps.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//
3// FileOps.h
4//
5// Cross-platform File Operations
6//
7// Copyright (c) 2012 Greg Satz <satz@iranger.com>
8// All rights reserved.
9//
10// SOFTWARE NOTICE AND LICENSE
11//
12// This file is part of OpenZWave.
13//
14// OpenZWave is free software: you can redistribute it and/or modify
15// it under the terms of the GNU Lesser General Public License as published
16// by the Free Software Foundation, either version 3 of the License,
17// or (at your option) any later version.
18//
19// OpenZWave is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU Lesser General Public License for more details.
23//
24// You should have received a copy of the GNU Lesser General Public License
25// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
26//
27//-----------------------------------------------------------------------------
28#ifndef _FileOps_H
29#define _FileOps_H
30
31#include <stdarg.h>
32#include <string>
33#include "Defs.h"
34
35namespace OpenZWave
36{
37 namespace Internal
38 {
39 namespace Platform
40 {
41 class FileOpsImpl;
42
46 class FileOps
47 {
48 public:
54 static FileOps* Create();
55
60 static void Destroy();
61
67 static bool FolderExists(const string &_folderName);
68
74 static bool FileExists(const string &_fileName);
75
81 static bool FileWriteable(const string &_fileName);
82
88 static bool FileRotate(const string &_fileName);
89
96 static bool FileCopy(const string &_fileName, const string &_destinationfile);
97
103 static bool FolderCreate(const string &_folderName);
104
105 private:
106 FileOps();
107 ~FileOps();
108
109 static FileOpsImpl* m_pImpl; // Pointer to an object that encapsulates the platform-specific implementation of the FileOps.
110 static FileOps* s_instance;
111 };
112 } // namespace Platform
113 } // namespace Internal
114} // namespace OpenZWave
115
116#endif //_FileOps_H
117
Implements platform-independent File Operations.
Definition: FileOps.h:47
static void Destroy()
Definition: FileOps.cpp:66
static FileOps * Create()
Definition: FileOps.cpp:53
static bool FileRotate(const string &_fileName)
Definition: FileOps.cpp:118
static bool FileExists(const string &_fileName)
Definition: FileOps.cpp:90
static bool FolderCreate(const string &_folderName)
Definition: FileOps.cpp:148
static bool FileWriteable(const string &_fileName)
Definition: FileOps.cpp:104
static bool FileCopy(const string &_fileName, const string &_destinationfile)
Definition: FileOps.cpp:133
static bool FolderExists(const string &_folderName)
Definition: FileOps.cpp:76
Definition: Bitfield.cpp:31