本文整理汇总了C++中SimpleString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleString::IsEmpty方法的具体用法?C++ SimpleString::IsEmpty怎么用?C++ SimpleString::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleString
的用法示例。
在下文中一共展示了SimpleString::IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOmiscidServiceDnsSdType
const SimpleString CommonServiceValues::GetOmiscidServiceDnsSdType()
{
static SimpleString OmiscidServiceDnsSdType;
if ( OmiscidServiceDnsSdType.IsEmpty() )
{
SimpleString DefaultDomain = "_bip._tcp";
char * Option = getenv( "OMISCID_WORKING_DOMAIN" );
if ( Option == NULL || DefaultDomain == Option )
{
OmiscidServiceDnsSdType = DefaultDomain;
OmiscidTrace( "OMiSCID working domain not override. Use '%s'.\n", DefaultDomain.GetStr() );
return OmiscidServiceDnsSdType;
}
// Copy the environment variable
size_t size = strlen( Option );
TemporaryMemoryBuffer tmpdomain(128);
if ( size >= RegtypeLength )
{
SimpleString Msg = "OMiSCID working domain '";
Msg += Option;
Msg += "' too long (";
Msg += (RegtypeLength-1);
Msg += ")";
// Set default domain in cas of exception catch
OmiscidServiceDnsSdType = DefaultDomain;
OmiscidError( Msg.GetStr() );
throw SimpleException( Msg );
}
if ( sscanf( Option, "_bip_%[^.]._tcp", (char*)tmpdomain) == 1 )
{
// Set default domain in cas of exception catch
OmiscidServiceDnsSdType = DefaultDomain;
OmiscidError( "Old style OMiSCID working domain, please conform to new 'XXX._bip._tcp' pattern" );
throw SimpleException( "Old style OMiSCID working domain, please conform to new 'XXX._bip._tcp' pattern" );
}
if ( sscanf( Option, "%[^.]._bip._tcp", (char*)tmpdomain) == 1 )
{
OmiscidServiceDnsSdType = Option;
OmiscidTrace( "OMISCID_WORKING_DOMAIN defined in environment variable. Use '%s'.\n", OmiscidServiceDnsSdType.GetStr() );
return OmiscidServiceDnsSdType;
}
// OMiSCID Domain simplest way to define it
OmiscidServiceDnsSdType = Option;
OmiscidTrace( "OMISCID_WORKING_DOMAIN defined in environment variable. Use '%s'.\n", OmiscidServiceDnsSdType.GetStr() );
}
return OmiscidServiceDnsSdType;
}