ImR_Utils Class Reference

#include <utils.h>

List of all members.

Static Public Member Functions

ACE_CString activationModeToString (ImplementationRepository::ActivationMode mode)
ImplementationRepository::ActivationMode parseActivationMode (const ACE_CString &s)
ACE_CString envListToString (const ImplementationRepository::EnvironmentList &lst)
ImplementationRepository::EnvironmentList parseEnvList (const ACE_CString &s)


Member Function Documentation

ACE_CString ImR_Utils::activationModeToString ImplementationRepository::ActivationMode  mode  )  [inline, static]
 

Definition at line 15 of file utils.h.

References ACE_ASSERT, and ACE_CString.

Referenced by ImR_Locator_i::add_or_update_server(), and saveAsXML().

00016   {
00017     switch (mode )
00018     {
00019     case ImplementationRepository::NORMAL:
00020       return "NORMAL";
00021     case ImplementationRepository::MANUAL:
00022       return "MANUAL";
00023     case ImplementationRepository::PER_CLIENT:
00024       return "PER_CLIENT";
00025     case ImplementationRepository::AUTO_START:
00026       return "AUTO_START";
00027     default:
00028       ACE_ASSERT(mode == ImplementationRepository::NORMAL);
00029       return "";
00030     }
00031   }

ACE_CString ImR_Utils::envListToString const ImplementationRepository::EnvironmentList &  lst  )  [inline, static]
 

Definition at line 45 of file utils.h.

References ACE_CString.

Referenced by Locator_Repository::update_server().

00046   {
00047     ACE_CString ret;
00048     for (CORBA::ULong n = 0; n < lst.length(); ++n)
00049     {
00050       ret += "name=\"";
00051       ret += lst[n].name.in();
00052       ret += "\" value=\"";
00053       ret += lst[n].value.in();
00054       ret += "\"\n";
00055     }
00056     return ret;
00057   }

ImplementationRepository::ActivationMode ImR_Utils::parseActivationMode const ACE_CString s  )  [inline, static]
 

Definition at line 32 of file utils.h.

Referenced by Server_Repo_XML_Callback::next_server().

00033   {
00034     if (s == "NORMAL")
00035       return ImplementationRepository::NORMAL;
00036     if (s == "MANUAL")
00037       return ImplementationRepository::MANUAL;
00038     if (s == "PER_CLIENT")
00039       return ImplementationRepository::PER_CLIENT;
00040     if (s == "AUTO_START")
00041       return ImplementationRepository::AUTO_START;
00042 
00043     return ImplementationRepository::NORMAL;
00044   }

ImplementationRepository::EnvironmentList ImR_Utils::parseEnvList const ACE_CString s  )  [inline, static]
 

Definition at line 58 of file utils.h.

References ACE_CString, and ssize_t.

Referenced by loadServersAsBinary().

00059   {
00060     ImplementationRepository::EnvironmentList ret(10);
00061 
00062     const ACE_CString NAMETAG = "name=\"";
00063     const ACE_CString VALTAG = "value=\"";
00064     const ACE_CString ENDTAG = "\"";
00065 
00066     ssize_t i = 0;
00067 
00068     for (CORBA::ULong idx = 0; ; ++idx)
00069     {
00070       // find name
00071       ssize_t j = s.find(NAMETAG, i);
00072       if (j == ACE_CString::npos) break;
00073       j += NAMETAG.length();
00074       ssize_t k = s.find(ENDTAG, j + 1);
00075       if (k == ACE_CString::npos) break;
00076       ACE_CString name = s.substr(j, k - j);
00077 
00078       i = k + 1;
00079 
00080       // find value
00081       j = s.find(VALTAG, i);
00082       if (j == ACE_CString::npos) break;
00083       j += VALTAG.length();
00084       k = s.find(ENDTAG, j + 1);
00085       if (k == ACE_CString::npos) break;
00086       ACE_CString value = s.substr(j, k - j);
00087 
00088       i = k + 1;
00089 
00090       ret.length(idx + 1);
00091       ret[idx].name = name.c_str();
00092       ret[idx].value = value.c_str();
00093     }
00094     return ret;
00095   }


The documentation for this class was generated from the following file:
Generated on Thu Nov 9 13:37:18 2006 for TAO_Implementation_Repository by doxygen 1.3.6