edelib 2.1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

EdbusObjectPath.h
1 /*
2 * $Id: EdbusObjectPath.h 2839 2009-09-28 11:36:20Z karijes $
3 *
4 * D-BUS stuff
5 * Copyright (c) 2008 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_EDBUSOBJECTPATH_H__
22 #define __EDELIB_EDBUSOBJECTPATH_H__
23
24 #include "String.h"
25
26 EDELIB_NS_BEGIN
27
58 class EDELIB_API EdbusObjectPath {
59 private:
60 String val;
61 EdbusObjectPath& operator=(const EdbusObjectPath&);
62
63 public:
67 EdbusObjectPath();
68
75 EdbusObjectPath(const char* str);
76
80 EdbusObjectPath(const EdbusObjectPath&);
81
85 ~EdbusObjectPath();
86
95 void append(const char* str);
96
100 void clear(void);
101
105 const char* path(void) const { return val.c_str(); }
106
112 bool operator==(const EdbusObjectPath& other) { return val == other.val; }
113
119 bool operator!=(const EdbusObjectPath& other) { return !operator==(other); }
120
127 static bool valid_element(const char* str);
128
135 static bool valid_path(const char* str);
136
144 static bool valid_path(const EdbusObjectPath& path) { return valid_path(path.path()); }
145 };
146
151 inline EdbusObjectPath& operator<<(EdbusObjectPath& p, const char* el) {
152 p.append(el);
153 return p;
154 }
155
156 EDELIB_NS_END
157 #endif
edelib::EdbusObjectPath::path
const char * path(void) const
Definition: EdbusObjectPath.h:105
edelib::EdbusObjectPath::operator!=
bool operator!=(const EdbusObjectPath &other)
Definition: EdbusObjectPath.h:119
edelib::EdbusObjectPath::operator==
bool operator==(const EdbusObjectPath &other)
Definition: EdbusObjectPath.h:112
edelib::EdbusObjectPath
Represents D-Bus object path.
Definition: EdbusObjectPath.h:58
edelib::String::c_str
const char * c_str(void)
Definition: String.h:279
edelib::operator<<
EdbusObjectPath & operator<<(EdbusObjectPath &p, const char *el)
Definition: EdbusObjectPath.h:151
edelib::String
A (relatively simple) string implementation.
Definition: String.h:82
edelib::EdbusObjectPath::valid_path
static bool valid_path(const EdbusObjectPath &path)
Definition: EdbusObjectPath.h:144
edelib::EdbusObjectPath::append
void append(const char *str)