blocxx
FileSystemMockObject.cpp
Go to the documentation of this file.
1/*******************************************************************************
2* Copyright (C) 2005, Quest Software, Inc. All rights reserved.
3* Copyright (C) 2006, Novell, Inc. All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7*
8* * Redistributions of source code must retain the above copyright notice,
9* this list of conditions and the following disclaimer.
10* * Redistributions in binary form must reproduce the above copyright
11* notice, this list of conditions and the following disclaimer in the
12* documentation and/or other materials provided with the distribution.
13* * Neither the name of
14* Quest Software, Inc.,
15* nor Novell, Inc.,
16* nor the names of its contributors or employees may be used to
17* endorse or promote products derived from this software without
18* specific prior written permission.
19*
20* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30* POSSIBILITY OF SUCH DAMAGE.
31*******************************************************************************/
32
33
38#include "blocxx/BLOCXX_config.h"
40#include "blocxx/Exception.hpp"
41#include "blocxx/File.hpp"
42#include "blocxx/String.hpp"
43#include "blocxx/Array.hpp"
44
45namespace BLOCXX_NAMESPACE
46{
47
48BLOCXX_DECLARE_EXCEPTION(FileSystemMockObjectUnimplemented);
49BLOCXX_DEFINE_EXCEPTION(FileSystemMockObjectUnimplemented);
50
54
55File
60File
65File
70File
75File
80File
85int
90bool
95#ifndef BLOCXX_WIN32
96bool
101#endif
102bool
107bool
112#ifndef BLOCXX_WIN32
113bool
118#endif
119bool
124bool
129bool
134bool
139UInt64
144bool
149bool
154bool
159bool
160FileSystemMockObject::renameFile(const String& oldFileName, const String& newFileName)
161{
163}
164size_t
165FileSystemMockObject::read(const FileHandle& hdl, void* bfr, size_t numberOfBytes, Int64 offset)
166{
168}
169size_t
170FileSystemMockObject::write(FileHandle hdl, const void* bfr, size_t numberOfBytes, Int64 offset)
171{
173}
174Int64
175FileSystemMockObject::seek(const FileHandle& hdl, Int64 offset, int whence)
176{
178}
179Int64
184void
189int
194int
199String
209String
214String
219
220std::pair<FileSystem::Path::ESecurity, String>
225
226std::pair<FileSystem::Path::ESecurity, String>
231
232std::pair<FileSystem::Path::ESecurity, String>
233FileSystemMockObject::security(String const & base_dir, String const & rel_path, UserId uid)
234{
236}
237
238std::pair<FileSystem::Path::ESecurity, String>
239FileSystemMockObject::security(String const & base_dir, String const & rel_path)
240{
242}
243
244String
249
250String
255
256String
261
262
263} // end namespace BLOCXX_NAMESPACE
264
265
266
267
#define BLOCXX_DEFINE_EXCEPTION(NAME)
Define a new exception class named <NAME>Exception that derives from Exception.
#define BLOCXX_DECLARE_EXCEPTION(NAME)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
The purpose of the File class is to provide an abstraction layer over the platform dependant function...
Definition File.hpp:55
virtual int changeFileOwner(const String &filename, const UserId &userId)
virtual String readSymbolicLink(const String &path)
virtual bool removeFile(const String &path)
virtual bool renameFile(const String &oldFileName, const String &newFileName)
virtual bool getDirectoryContents(const String &path, StringArray &dirEntries)
virtual File openFile(const String &path)
virtual bool changeDirectory(const String &path)
virtual File openOrCreateFile(const String &path)
virtual bool makeDirectory(const String &path, int mode=0777)
virtual File openForAppendOrCreateFile(const String &path)
virtual String basename(const String &filename)
virtual String dirname(const String &filename)
virtual String realPath(const String &path)
virtual bool canRead(const String &path)
virtual bool exists(const String &path)
virtual size_t read(const FileHandle &hdl, void *bfr, size_t numberOfBytes, Int64 offset=-1L)
virtual void rewind(const FileHandle &hdl)
virtual bool isDirectory(const String &path)
virtual Int64 seek(const FileHandle &hdl, Int64 offset, int whence)
virtual bool isLink(const String &path)
virtual bool getFileSize(const String &path, Int64 &size)
virtual String getFileContents(const String &filename)
virtual std::pair< FileSystem::Path::ESecurity, String > security(String const &path, UserId uid)
virtual File createFile(const String &path)
virtual int close(const FileHandle &hdl)
virtual size_t write(FileHandle hdl, const void *bfr, size_t numberOfBytes, Int64 offset=-1L)
virtual bool removeDirectory(const String &path)
virtual bool isExecutable(const String &path)
virtual File createTempFile(const String &dir)
virtual bool canWrite(const String &path)
virtual StringArray getFileLines(const String &filename)
virtual Int64 tell(const FileHandle &hdl)
This String class is an abstract data type that represents as NULL terminated string of characters.
Definition String.hpp:67
Taken from RFC 1321.