00001 /* 00002 * PropertyConiguratorImpl.hh 00003 * 00004 * Copyright 2002, Log4cpp Project. All rights reserved. 00005 * 00006 * See the COPYING file for the terms of usage and distribution. 00007 */ 00008 00009 #ifndef _LOG4CPP_PROPERTYCONFIGURATORIMPL_HH 00010 #define _LOG4CPP_PROPERTYCONFIGURATORIMPL_HH 00011 00012 #include "PortabilityImpl.hh" 00013 #include <log4cpp/Configurator.hh> 00014 #include <log4cpp/Appender.hh> 00015 #include <log4cpp/Category.hh> 00016 #include <string> 00017 #include <iostream> 00018 #include <map> 00019 #include <vector> 00020 00021 #include "Properties.hh" 00022 00023 namespace log4cpp { 00024 00025 class PropertyConfiguratorImpl { 00026 public: 00027 typedef std::map<std::string, Appender*> AppenderMap; 00028 00029 PropertyConfiguratorImpl(); 00030 virtual ~PropertyConfiguratorImpl(); 00037 virtual void doConfigure(const std::string& initFileName); 00044 virtual void doConfigure(std::istream& in); 00045 00046 protected: 00056 void configureCategory(const std::string& categoryname); 00057 00063 void getCategories(std::vector<std::string>& categories) const; 00064 00065 void instantiateAllAppenders(); 00066 00080 Appender* instantiateAppender(const std::string& name); 00081 00088 void setLayout(Appender* appender, const std::string& name); 00089 00090 Properties _properties; 00091 AppenderMap _allAppenders; 00092 }; 00093 } 00094 00095 #endif // _LOG4CPP_PROPERTIES_HH 00096