dbus-cxx
path.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
2/***************************************************************************
3 * Copyright (C) 2009,2010 by Rick L. Vinyard, Jr. *
4 * rvinyard@cs.nmsu.edu *
5 * *
6 * This file is part of the dbus-cxx library. *
7 ***************************************************************************/
8#include <string>
9#include <vector>
10
11#ifndef DBUSCXX_PATH_H
12#define DBUSCXX_PATH_H
13
14namespace DBus {
15
21class Path: public std::string {
22public:
23 Path();
24
25 Path( const std::string& s, size_type pos = 0, size_type n = npos );
26
27 Path( const char* );
28
29 Path( const char* s, size_type n );
30
31 Path( size_type n, char c );
32
33 template<class InputIterator>
34 Path( InputIterator first, InputIterator last ): std::string( first, last ) { }
35
36 ~Path();
37
38 operator bool() const;
39
40 bool is_valid() const;
41
42 bool is_root() const;
43
54 std::vector<std::string> decomposed() const;
55
65 bool append_element( const std::string& element );
66
75 static Path relative_path( const Path& first, const Path& second );
76
77};
78
79}
80
81#endif
Represents a DBus Path.
Definition: path.h:21
std::vector< std::string > decomposed() const
Decomposes the string into its component elements.
Definition: path.cpp:56
static Path relative_path(const Path &first, const Path &second)
Create a relative path between the two paths.
Definition: path.cpp:121
~Path()
Definition: path.cpp:33
bool is_valid() const
Definition: path.cpp:40
Path()
Definition: path.cpp:14
bool is_root() const
Definition: path.cpp:113
bool append_element(const std::string &element)
Adds the element string to the path ensuring delimeters are properly taken care of.
Definition: path.cpp:87
Path(InputIterator first, InputIterator last)
Definition: path.h:34
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
const Signature::size_type npos
Definition: signature.cpp:22