EdbusObjectPath.h
/*
* $Id: EdbusObjectPath.h 2839 2009-09-28 11:36:20Z karijes $
*
* D-BUS stuff
* Copyright (c) 2008 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_EDBUSOBJECTPATH_H__
#define __EDELIB_EDBUSOBJECTPATH_H__
#include "String.h"
EDELIB_NS_BEGIN
class EDELIB_API EdbusObjectPath {
private:
String val;
EdbusObjectPath& operator=(const EdbusObjectPath&);
public:
EdbusObjectPath();
EdbusObjectPath(const char* str);
EdbusObjectPath(const EdbusObjectPath&);
~EdbusObjectPath();
void append(const char* str);
void clear(void);
const char* path(void) const { return val.c_str(); }
bool operator==(const EdbusObjectPath& other) { return val == other.val; }
bool operator!=(const EdbusObjectPath& other) { return !operator==(other); }
static bool valid_element(const char* str);
static bool valid_path(const char* str);
static bool valid_path(const EdbusObjectPath& path) { return valid_path(path.path()); }
};
inline EdbusObjectPath& operator<<(EdbusObjectPath& p, const char* el) {
p.append(el);
return p;
}
EDELIB_NS_END
#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)