00001 00002 #ifndef SCT_NAMEORREGEXP_H 00003 #define SCT_NAMEORREGEXP_H 00004 00005 #include "NameOrRegexp.fwd" 00006 00007 #include <string> 00008 #include <ostream> 00009 #include "omniORB4/CORBA.h" 00010 00011 std::ostream & operator<<(std::ostream & os, const Sct::NameOrRegexp & nor); 00012 00013 namespace Sct { 00014 00015 class NameOrRegexp { 00016 public: 00017 NameOrRegexp(const std::string & nameOrRegexp, const CORBA::Boolean is_regexp) : 00018 m_nameOrRegexp(nameOrRegexp), 00019 m_is_regexp(is_regexp) { 00020 }; 00021 const CORBA::Boolean is_regexp() const { 00022 return m_is_regexp; 00023 }; 00024 std::ostream & printMeTo(std::ostream & os) const { 00025 return os << "NOR[" 00026 << (m_is_regexp ? "Regexp=" : "Name=") 00027 << "[" << m_nameOrRegexp << "]]"; 00028 }; 00029 bool matchesSomethingCalled(const std::string & name) const; 00030 std::string content() const { return m_nameOrRegexp; }; 00031 private: 00032 std::string m_nameOrRegexp; 00033 CORBA::Boolean m_is_regexp; 00034 }; 00035 00036 }; 00037 00038 inline std::ostream & operator<<(std::ostream & os, const Sct::NameOrRegexp & nor) { 00039 return nor.printMeTo(os); 00040 }; 00041 00042 #endif