Apache log4cxx  Version 0.11.0
properties.h
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 #if defined(_MSC_VER)
22  #pragma warning (push)
23  #pragma warning ( disable: 4231 4251 4275 4786 )
24 #endif
25 
26 
27 #include <log4cxx/logstring.h>
28 #include <log4cxx/helpers/objectptr.h>
29 #include <log4cxx/helpers/objectimpl.h>
30 #include <log4cxx/helpers/inputstream.h>
31 #include <map>
32 #include <vector>
33 #include <istream>
34 
35 namespace log4cxx
36 {
37 namespace helpers
38 {
39 class LOG4CXX_EXPORT Properties
40 {
41  private:
42  typedef std::map<LogString, LogString> PropertyMap;
43  PropertyMap* properties;
44  Properties(const Properties&);
45  Properties& operator=(const Properties&);
46 
47  public:
51  Properties();
55  ~Properties();
133  void load(InputStreamPtr inStream);
134 
142  LogString setProperty(const LogString& key, const LogString& value);
150  LogString put(const LogString& key, const LogString& value);
151 
152 
159  LogString getProperty(const LogString& key) const;
166  LogString get(const LogString& key) const;
167 
176  std::vector<LogString> propertyNames() const;
177 }; // class Properties
178 } // namespace helpers
179 } // namespace log4cxx
180 
181 #if defined(_MSC_VER)
182  #pragma warning (pop)
183 #endif
184 
185 
186 #endif //_LOG4CXX_HELPER_PROPERTIES_H
Definition: properties.h:39
Definition: appender.h:33