本文整理汇总了C++中tiny_string::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ tiny_string::empty方法的具体用法?C++ tiny_string::empty怎么用?C++ tiny_string::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tiny_string
的用法示例。
在下文中一共展示了tiny_string::empty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XMLNode
XMLDocument::XMLDocument(Class_base* c, tiny_string s)
: XMLNode(c),rootNode(NULL),ignoreWhite(false)
{
if(!s.empty())
{
parseXMLImpl(s);
}
}
示例2: openLink
void nsPluginInstance::openLink(const tiny_string& url, const tiny_string& window)
{
assert(!window.empty());
linkOpenData *data = new linkOpenData;
data->instance = mInstance;
data->url = url;
data->window = window;
NPN_PluginThreadAsyncCall(mInstance, asyncOpenPage, data);
}
示例3: toJSON
tiny_string Vector::toJSON(std::vector<ASObject *> &path, IFunction *replacer, const tiny_string &spaces, const tiny_string &filter)
{
bool ok;
tiny_string res = call_toJSON(ok,path,replacer,spaces,filter);
if (ok)
return res;
// check for cylic reference
if (std::find(path.begin(),path.end(), this) != path.end())
throwError<TypeError>(kJSONCyclicStructure);
path.push_back(this);
res += "[";
bool bfirst = true;
tiny_string newline = (spaces.empty() ? "" : "\n");
for (unsigned int i =0; i < vec.size(); i++)
{
tiny_string subres;
ASObject* o = vec[i];
if (!o)
o = getSystemState()->getNullRef();
if (replacer != NULL)
{
ASObject* params[2];
params[0] = abstract_di(getSystemState(),i);
params[0]->incRef();
params[1] = o;
params[1]->incRef();
ASObject *funcret=replacer->call(getSystemState()->getNullRef(), params, 2);
if (funcret)
subres = funcret->toJSON(path,NULL,spaces,filter);
}
else
{
subres = o->toJSON(path,replacer,spaces,filter);
}
if (!subres.empty())
{
if (!bfirst)
res += ",";
res += newline+spaces;
bfirst = false;
res += subres;
}
}
if (!bfirst)
res += newline+spaces.substr_bytes(0,spaces.numBytes()/2);
res += "]";
path.pop_back();
return res;
}
示例4: qualifiedString
const tiny_string multiname::qualifiedString(SystemState* sys) const
{
assert_and_throw(ns.size()>=1);
assert_and_throw(name_type==NAME_STRING);
const tiny_string nsName=sys->getStringFromUniqueId(ns[0].nsNameId);
const tiny_string& name=sys->getStringFromUniqueId(name_s_id);
if(nsName.empty())
return name;
else
{
tiny_string ret=nsName;
ret+="::";
ret+=name;
return ret;
}
}
示例5: isValidQName
bool Array::isValidQName(const tiny_string& name, const tiny_string& ns, unsigned int& index)
{
if(ns!="")
return false;
assert_and_throw(!name.empty());
index=0;
//First we try to convert the string name to an index, at the first non-digit
//we bail out
for(auto i=name.begin(); i!=name.end(); ++i)
{
if(!i.isdigit())
return false;
index*=10;
index+=i.digit_value();
}
return true;
}
示例6: isIntegerWithoutLeadingZeros
bool Array::isIntegerWithoutLeadingZeros(const tiny_string& value)
{
if (value.empty())
return false;
else if (value == "0")
return true;
bool first = true;
for (CharIterator it=value.begin(); it!=value.end(); ++it)
{
if (!it.isdigit() || (first && *it == '0'))
return false;
first = false;
}
return true;
}
示例7: connect
void XMLSocket::connect(tiny_string host, int port)
{
if (port <= 0 || port > 65535)
throw Class<SecurityError>::getInstanceS(getSystemState(),"Invalid port");
if (host.empty())
host = getSys()->mainClip->getOrigin().getHostname();
if (isConnected())
throw Class<IOError>::getInstanceS(getSystemState(),"Already connected");
// Host shouldn't contain scheme or port
if (host.strchr(':') != NULL)
throw Class<SecurityError>::getInstanceS(getSystemState(),"Invalid hostname");
// Check sandbox and policy file
size_t buflen = host.numBytes() + 22;
char *urlbuf = g_newa(char, buflen);
snprintf(urlbuf, buflen, "xmlsocket://%s:%d", host.raw_buf(), port);
URLInfo url(urlbuf);
getSystemState()->securityManager->checkURLStaticAndThrow(url,
~(SecurityManager::LOCAL_WITH_FILE),
SecurityManager::LOCAL_WITH_FILE | SecurityManager::LOCAL_TRUSTED,
true);
SecurityManager::EVALUATIONRESULT evaluationResult;
evaluationResult = getSys()->securityManager->evaluateSocketConnection(url, true);
if(evaluationResult != SecurityManager::ALLOWED)
{
incRef();
getVm(getSystemState())->addEvent(_MR(this), _MR(Class<SecurityErrorEvent>::getInstanceS(getSystemState(),"No policy file allows socket connection")));
return;
}
incRef();
XMLSocketThread *thread = new XMLSocketThread(_MR(this), host, port, timeout);
getSys()->addJob(thread);
job = thread;
}