本文整理汇总了C++中IPropertyTree::getPropInt方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyTree::getPropInt方法的具体用法?C++ IPropertyTree::getPropInt怎么用?C++ IPropertyTree::getPropInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyTree
的用法示例。
在下文中一共展示了IPropertyTree::getPropInt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendSchemaResource
void appendSchemaResource(IPropertyTree &res, ILoadedDllEntry *dll)
{
if (!dll || (flags & WWV_OMIT_SCHEMAS))
return;
if (res.getPropInt("@seq", -1)>=0 && res.hasProp("@id"))
{
int id = res.getPropInt("@id");
size32_t len = 0;
const void *data = NULL;
if (dll->getResource(len, data, "RESULT_XSD", (unsigned) id) && len>0)
{
buffer.append("<XmlSchema name=\"").append(res.queryProp("@name")).append("\">");
if (res.getPropBool("@compressed"))
{
StringBuffer decompressed;
decompressResource(len, data, decompressed);
if (flags & WWV_CDATA_SCHEMAS)
buffer.append("<![CDATA[");
buffer.append(decompressed.str());
if (flags & WWV_CDATA_SCHEMAS)
buffer.append("]]>");
}
else
buffer.append(len, (const char *)data);
buffer.append("</XmlSchema>");
}
}
}
示例2: LINK
IHqlExpression * XmlEclRepository::doLoadSymbol(IPropertyTree * repository, IAtom * modname, IAtom * attrname)
{
StringBuffer s;
IPropertyTree* module = repository->queryPropTree(s.append("./Module[@name=\"").append(*modname).append("\"]").str());
if(!module)
{
if (logging())
DBGLOG("No data for module %s",modname->getAtomNamePtr());
return 0;
}
int access = module->getPropInt("@access",cs_full);
s.clear().append("./Attribute[@name=\"").append(*attrname).append("\"]");
Owned<IPropertyTreeIterator> it = module->getElements(s.str());
for(it->first();it->isValid();it->next())
{
Owned<IHqlExpression> item = toNamedSymbol(&it->query(), *modname,access);
CHqlNamedSymbol* cur = QUERYINTERFACE(item.get(), CHqlNamedSymbol);
if(cur)
return LINK(cur);
}
return 0;
}
示例3: getDefaultPort
int SWProcess::getDefaultPort()
{
IPropertyTree * portAttrNode = getPortDefinition();
if (!portAttrNode) return 0;
int defaultValue = portAttrNode->getPropInt("@default");
if (!defaultValue) return 0;
return defaultValue;
}
示例4: doLoadModule
bool XmlEclRepository::doLoadModule(IPropertyTree * repository, IHqlRemoteScope * rScope, IErrorReceiver *errs)
{
IHqlScope * scope = rScope->queryScope();
const char * scopeName = scope->queryName()->getAtomNamePtr();
StringBuffer s;
const char * modName = scope->queryFullName();
IPropertyTree* module = repository->queryPropTree(s.append("./Module[@name=\"").append(modName).append("\"]").str());
if(!module)
{
if (logging())
DBGLOG("No data for module %s",scopeName);
return false;
}
int access = module->getPropInt("@access",cs_full);
if(module->queryProp("Text"))
{
const char * path = module->queryProp("@sourcePath");
Owned<ISourcePath> sourcePath = createSourcePath(path ? path : modName);
Owned<IFileContents> text = createFileContentsFromText(module->queryProp("Text"), sourcePath);
rScope->setText(text);
}
else
{
StringBuffer buf("./Attribute");
Owned<IPropertyTreeIterator> it = module->getElements(buf.str());
if (it->first())
{
for(;it->isValid();it->next())
{
Owned<IHqlExpression> item = toNamedSymbol(&it->query(), *scope->queryName(), access);
((CHqlScope*)scope)->defineSymbol(LINK(item));
}
}
else
{
if (logging())
DBGLOG("No definitions were added for module %s", scopeName);
}
}
return true;
}
示例5: MakeStringException
CEclDirectSoapBindingEx::CEclDirectSoapBindingEx(IPropertyTree* cfg, const char *binding, const char *process):CEclDirectSoapBinding(cfg, binding, process)
{
StringBuffer xpath;
xpath.appendf("Software/EspProcess[@name='%s']", process);
IPropertyTree *procTree = cfg->queryPropTree(xpath.str());
if (!procTree)
throw MakeStringException(-1, "EclDirect Configuration Error: unable to find process");
xpath.set("EspBinding[@name='").append(binding).append("']/@port");
int port = procTree->getPropInt(xpath.str());
if (port)
{
xpath.set("EspBinding[@type='ws_workunitsSoapBinding'][@port='").append(port).append("']");
redirect = procTree->hasProp(xpath.str());
}
SCMStringBuffer s;
Owned<IStringIterator> it = getTargetClusters(NULL, NULL);
ForEach(*it)
clusters.append(it->str(s).str());
supportRepository = false;
}
示例6: main
int main(int argc,char **argv)
{
InitModuleObjects();
EnableSEHtoExceptionMapping();
#ifndef __64BIT__
// Restrict stack sizes on 32-bit systems
Thread::setDefaultStackSize(0x10000); // 64K stack (also set in windows DSP)
#endif
Owned<IFile> sentinelFile = createSentinelTarget();
removeSentinelFile(sentinelFile);
SocketEndpoint listenep;
unsigned sendbufsize = 0;
unsigned recvbufsize = 0;
int i = 1;
bool isdaemon = (memicmp(argv[0]+strlen(argv[0])-4,".exe",4)==0);
// bit of a kludge for windows - if .exe not specified then not daemon
bool locallisten = false;
const char *logdir=NULL;
bool requireauthenticate = false;
StringBuffer logDir;
StringBuffer instanceName;
//Get SSL Settings
const char * sslCertFile;
bool useSSL;
unsigned short dafsPort;//DAFILESRV_PORT or SECURE_DAFILESRV_PORT
querySecuritySettings(&useSSL, &dafsPort, &sslCertFile, NULL);
unsigned parallelRequestLimit = DEFAULT_PARALLELREQUESTLIMIT;
unsigned throttleDelayMs = DEFAULT_THROTTLEDELAYMS;
unsigned throttleCPULimit = DEFAULT_THROTTLECPULIMIT;
Owned<IPropertyTree> env = getHPCCEnvironment();
if (env)
{
StringBuffer dafilesrvPath("Software/DafilesrvProcess");
if (instanceName.length())
dafilesrvPath.appendf("[@name=\"%s\"]", instanceName.str());
IPropertyTree *daFileSrv = env->queryPropTree(dafilesrvPath);
if (daFileSrv)
{
// global DaFileSrv settings:
parallelRequestLimit = daFileSrv->getPropInt("@parallelRequestLimit", DEFAULT_PARALLELREQUESTLIMIT);
throttleDelayMs = daFileSrv->getPropInt("@throttleDelayMs", DEFAULT_THROTTLEDELAYMS);
throttleCPULimit = daFileSrv->getPropInt("@throttleCPULimit", DEFAULT_THROTTLECPULIMIT);
// any overrides by Instance definitions?
// NB: This won't work if netAddress is "." or if we start supporting hostnames there
StringBuffer ipStr;
queryHostIP().getIpText(ipStr);
VStringBuffer daFileSrvPath("Instance[@netAddress=\"%s\"]", ipStr.str());
IPropertyTree *dafileSrvInstance = daFileSrv->queryPropTree(daFileSrvPath);
if (dafileSrvInstance)
{
parallelRequestLimit = dafileSrvInstance->getPropInt("@parallelRequestLimit", parallelRequestLimit);
throttleDelayMs = dafileSrvInstance->getPropInt("@throttleDelayMs", throttleDelayMs);
throttleCPULimit = dafileSrvInstance->getPropInt("@throttleCPULimit", throttleCPULimit);
}
}
}
while (argc>i) {
if (stricmp(argv[i],"-D")==0) {
i++;
isdaemon = true;
}
else if (stricmp(argv[i],"-R")==0) { // for remote run
i++;
#ifdef _WIN32
isdaemon = false;
#else
isdaemon = true;
#endif
}
else if (stricmp(argv[i],"-A")==0) {
i++;
requireauthenticate = true;
}
else if ((argv[i][0]=='-')&&(toupper(argv[i][1])=='T')&&(!argv[i][2]||isdigit(argv[i][2]))) {
if (argv[i][2])
setDafsTrace(NULL,(byte)atoi(argv[i]+2));
i++;
isdaemon = false;
}
else if ((argc>i+1)&&(stricmp(argv[i],"-L")==0)) {
i++;
logDir.clear().append(argv[i++]);
}
else if ((argc>i+1)&&(stricmp(argv[i],"-I")==0)) {
i++;
instanceName.clear().append(argv[i++]);
}
else if (stricmp(argv[i],"-LOCAL")==0) {
i++;
locallisten = true;
}
else if (stricmp(argv[i],"-NOSSL")==0) {//overrides config setting
i++;
if (useSSL)
//.........这里部分代码省略.........
示例7: sendRequest
void sendRequest()
{
if (!loggingManager)
{
printf("No logging manager.\n");
return;
}
StringBuffer action, option, status;
testData->getProp("action", action);
testData->getProp("option", option);
if (action.length() && strieq(action.str(), "getTransactionSeed"))
{
StringBuffer transactionSeed;
loggingManager->getTransactionSeed(transactionSeed, status);
if (transactionSeed.length())
printf("Got transactionSeed: <%s>\n", transactionSeed.str());
}
else if (action.length() && strieq(action.str(), "UpdateLog"))
{
IPropertyTree* logContentTree = testData->queryPropTree("LogContent");
if (!logContentTree)
{
printf("can't read log content.\n");
return;
}
StringBuffer logContentXML;
toXML(logContentTree, logContentXML);
printf("log content: <%s>.\n", logContentXML.str());
Owned<IEspContext> espContext = createEspContext();
const char* userName = logContentTree->queryProp("ESPContext/UserName");
const char* sourceIP = logContentTree->queryProp("ESPContext/SourceIP");
short servPort = logContentTree->getPropInt("ESPContext/Port");
espContext->setUserID(userName);
espContext->setServAddress(sourceIP, servPort);
const char* backEndResp = logContentTree->queryProp("BackEndResponse");
IPropertyTree* userContextTree = logContentTree->queryPropTree("MyUserContext");
IPropertyTree* userRequestTree = logContentTree->queryPropTree("MyUserRequest");
IPropertyTree* userRespTree = logContentTree->queryPropTree("MyUserResponseEx");
StringBuffer userContextXML, userRequestXML, userRespXML;
toXML(userRespTree, userRespXML);
toXML(userContextTree, userContextXML);
toXML(userRequestTree, userRequestXML);
printf("userContextXML: <%s>.\n", userContextXML.str());
printf("userRequestXML: <%s>.\n", userRequestXML.str());
printf("userRespXML: <%s>.\n", userRespXML.str());
printf("backEndResp: <%s>.\n", backEndResp);
//Sleep(5000); //Waiting for loggingManager to start
loggingManager->updateLog(option.str(), *espContext, userContextTree, userRequestTree, backEndResp, userRespXML.str(), status);
}
else if (action.length() && strieq(action.str(), "UpdateLog1"))
{
IPropertyTree* logContentTree = testData->queryPropTree("LogContent");
if (!logContentTree)
{
printf("can't read log content.\n");
return;
}
StringBuffer logContentXML;
toXML(logContentTree, logContentXML);
printf("log content: <%s>.\n", logContentXML.str());
//Sleep(5000); //Waiting for loggingManager to start
loggingManager->updateLog(option.str(), logContentXML.str(), status);
}
else
printf("Invalid action.\n");
}
示例8: WARNLOG
CLocalDataLogger::CLocalDataLogger(IPropertyTree *cfg, const char *process, const char *service, const char* UrlRoot)
{
StringBuffer _directoryCache,xpath;
xpath.appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/localCache/", process, service);
IPropertyTree* cacheprop = cfg->queryBranch(xpath.str());
if(cacheprop==0)
{
WARNLOG(-1,"No local cache defined for %s service.",service);
return;
}
Init(cacheprop->queryProp("@cache"),cacheprop->queryProp("@fileExtension"),UrlRoot,cacheprop->getPropInt("@timerPeriod"),cacheprop->getPropInt("@cacheTimeout"));
}