Apache Log4cxx  Version 1.7.0
properties.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_HELPER_PROPERTIES_H
19 #define _LOG4CXX_HELPER_PROPERTIES_H
20 
21 #include <log4cxx/logstring.h>
22 #include <log4cxx/helpers/object.h>
24 #include <map>
25 #include <vector>
26 #include <istream>
27 
28 namespace LOG4CXX_NS
29 {
30 namespace helpers
31 {
32 class LOG4CXX_EXPORT Properties
33 {
34  private:
35  typedef std::map<LogString, LogString> PropertyMap;
36  PropertyMap* properties;
37 
38  public: // ...structors
44  Properties(const Properties&&) = delete;
46  Properties& operator=(const Properties&&) = delete;
51 
52  public: // Methods
55  bool isEmpty() const;
56 
134  void load(InputStreamPtr inStream);
135 
143  LogString setProperty(const LogString& key, const LogString& value);
151  LogString put(const LogString& key, const LogString& value);
152 
153 
160  LogString getProperty(const LogString& key) const;
167  LogString get(const LogString& key) const;
168 
177  std::vector<LogString> propertyNames() const;
178 }; // class Properties
179 } // namespace helpers
180 } // namespace log4cxx
181 
182 
183 #endif //_LOG4CXX_HELPER_PROPERTIES_H
Definition: properties.h:33
bool isEmpty() const
Does this contain any key-value pairs?
LogString setProperty(const LogString &key, const LogString &value)
Calls Properties::put.
std::vector< LogString > propertyNames() const
Returns an enumeration of all the keys in this property list, including distinct keys in the default ...
LogString get(const LogString &key) const
Gets a property value.
void load(InputStreamPtr inStream)
Reads a property list (key and element pairs) from the input stream.
LogString put(const LogString &key, const LogString &value)
Puts a property value into the collection.
LogString getProperty(const LogString &key) const
Calls Properties::get.
Properties(const Properties &&)=delete
Properties & operator=(const Properties &)
Properties(const Properties &)
Properties & operator=(const Properties &&)=delete
Properties()
Create new instance.
std::basic_string< logchar > LogString
Definition: logstring.h:60