reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
FileSystem.hxx
Go to the documentation of this file.
1#ifndef RESIP_FileSystem_hxx
2#define RESIP_FileSystem_hxx
3
5#include "rutil/Data.hxx"
6
7#if !defined(WIN32)
8#include <sys/types.h>
9#include <sys/stat.h>
10#include <sys/uio.h>
11#if defined(__ANDROID__)
12#include <fcntl.h>
13#else
14#include <sys/fcntl.h>
15#endif
16#include <unistd.h>
17#include <dirent.h>
18#else
19#include <direct.h>
20#include "rutil/Socket.hxx"
21#endif
22
23
24namespace resip
25{
26
32{
33 public:
34
35 class Exception final : public BaseException
36 {
37 public:
38 Exception(const Data& msg,
39 const Data& file,
40 const int line)
41 : BaseException(msg, file, line) {}
42 protected:
43 const char* name() const noexcept override { return "ConfigParse::Exception"; }
44 };
45
47 {
48 public:
51 typedef const value_type* const_pointer;
54
55 Directory(const Data& path);
56
58 {
59 public:
60 iterator(const Directory& dir);
61 iterator();
62 ~iterator();
63
65 bool operator!=(const iterator& rhs) const;
66 bool operator==(const iterator& rhs) const;
67 const Data& operator*() const;
68 const Data* operator->() const;
69 bool is_directory() const;
70 private:
71#ifdef WIN32
72 HANDLE mWinSearch;
73 bool mIsDirectory;
74#else
75 DIR* mNixDir;
76 struct dirent* mDirent;
77#endif
78 Data mFile;
79 Data mPath;
80 Data mFullFilename;
81 };
82
83 iterator begin() const;
84 iterator end() const;
85 const Data& getPath() const { return mPath; }
86 int create() const;
87 private:
88 Data mPath;
89 };
90};
91
92}
93
94#endif
95
96/* ====================================================================
97 * The Vovida Software License, Version 1.0
98 *
99 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
100 *
101 * Redistribution and use in source and binary forms, with or without
102 * modification, are permitted provided that the following conditions
103 * are met:
104 *
105 * 1. Redistributions of source code must retain the above copyright
106 * notice, this list of conditions and the following disclaimer.
107 *
108 * 2. Redistributions in binary form must reproduce the above copyright
109 * notice, this list of conditions and the following disclaimer in
110 * the documentation and/or other materials provided with the
111 * distribution.
112 *
113 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
114 * and "Vovida Open Communication Application Library (VOCAL)" must
115 * not be used to endorse or promote products derived from this
116 * software without prior written permission. For written
117 * permission, please contact vocal@vovida.org.
118 *
119 * 4. Products derived from this software may not be called "VOCAL", nor
120 * may "VOCAL" appear in their name, without prior written
121 * permission of Vovida Networks, Inc.
122 *
123 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
124 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
125 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
126 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
127 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
128 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
129 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
130 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
131 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
132 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
133 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
134 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
135 * DAMAGE.
136 *
137 * ====================================================================
138 *
139 * This software consists of voluntary contributions made by Vovida
140 * Networks, Inc. and many individuals on behalf of Vovida Networks,
141 * Inc. For more information on Vovida Networks, Inc., please see
142 * <http://www.vovida.org/>.
143 *
144 */
Handles cross-platform sockets compatibility.
The abstract base-class for all exceptions thrown by resip code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
bool operator==(const iterator &rhs) const
bool operator!=(const iterator &rhs) const
const value_type & const_reference
const value_type * const_pointer
const Data & getPath() const
Exception(const Data &msg, const Data &file, const int line)
const char * name() const noexcept override
Provides file-system traversal.
dcm! – add UnusedChecking(_enum) below;
void list()
Definition userAdmin.cxx:66