#include <dds_generator.h>
Collaboration diagram for ScopedNamespaceGuard:
Public Member Functions | |
ScopedNamespaceGuard (UTL_ScopedName *name, std::ostream &os, const char *keyword="namespace") | |
~ScopedNamespaceGuard () | |
Public Attributes | |
std::ostream & | os_ |
std::string | semi_ |
int | n_ |
Definition at line 151 of file dds_generator.h.
ScopedNamespaceGuard::ScopedNamespaceGuard | ( | UTL_ScopedName * | name, | |
std::ostream & | os, | |||
const char * | keyword = "namespace" | |||
) | [inline] |
Definition at line 152 of file dds_generator.h.
00154 : os_(os) 00155 { 00156 for (n_ = 0; name->tail(); 00157 name = static_cast<UTL_ScopedName*>(name->tail())) { 00158 const char* str = name->head()->get_string(); 00159 if (str && str[0]) { 00160 ++n_; 00161 os << keyword << (name->head()->escaped() ? " _" : " ") 00162 << str << " {\n"; 00163 } 00164 } 00165 if (std::strcmp(keyword, "module") == 0) semi_ = ";"; 00166 }
ScopedNamespaceGuard::~ScopedNamespaceGuard | ( | ) | [inline] |
Definition at line 175 of file dds_generator.h.
Referenced by ScopedNamespaceGuard(), and ~ScopedNamespaceGuard().
std::ostream& ScopedNamespaceGuard::os_ |
std::string ScopedNamespaceGuard::semi_ |
Definition at line 174 of file dds_generator.h.
Referenced by ScopedNamespaceGuard(), and ~ScopedNamespaceGuard().