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 
14 namespace DBus {
15 
21 class Path: public std::string {
22 public:
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 
52  std::vector<std::string> decomposed() const;
53 
63  bool append_element( const std::string& element );
64 
65 };
66 
67 }
68 
69 #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
~Path()
Definition: path.cpp:33
bool is_valid() const
Definition: path.cpp:40
Path()
Definition: path.cpp:14
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:18