/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/log/Selector.h

00001 #ifndef SELECTOR_H
00002 #define SELECTOR_H
00003 
00004 /*
00005  *
00006  * Copyright (c) 2006 The Apache Software Foundation
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License");
00009  * you may not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  *    http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  *
00020  */
00021 
00022 #include "Statement.h"
00023 #include <vector>
00024 
00025 namespace qpid {
00026 namespace log {
00027 class Options;
00028 
00034 class Selector {
00035   public:
00037     Selector() {}
00038 
00040     Selector(const Options&);
00041     
00043     Selector(Level l, const std::string& s=std::string()) {
00044         enable(l,s);
00045     }
00046 
00047     Selector(const std::string& enableStr) { enable(enableStr); }
00052     void enable(Level level, const std::string& substring=std::string()) {
00053         substrings[level].push_back(substring);
00054     }
00055 
00057     void enable(const std::string& enableStr);
00058 
00060     bool isEnabled(Level level, const std::string& function);
00061 
00062   private:
00063     std::vector<std::string> substrings[LevelTraits::COUNT];
00064 };
00065 
00066 
00067 }} // namespace qpid::log
00068 
00069 
00070 #endif  

Generated on Thu Apr 10 11:08:18 2008 for Qpid by  doxygen 1.4.7