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