本文整理汇总了C++中RemoteFilename::setPath方法的典型用法代码示例。如果您正苦于以下问题:C++ RemoteFilename::setPath方法的具体用法?C++ RemoteFilename::setPath怎么用?C++ RemoteFilename::setPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RemoteFilename
的用法示例。
在下文中一共展示了RemoteFilename::setPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
InitModuleObjects();
EnableSEHtoExceptionMapping();
if (argc<2) {
usage(argv[0]);
return -1;
}
bool forceGroupUpdate = false;
StringBuffer filename;
StringBuffer inst;
StringBuffer dcat;
StringBuffer dcomp;
StringBuffer dinst;
StringBuffer dip;
for (int i=1;i<argc;i++) {
if (argv[i][0]=='-') {
if ((stricmp(argv[i],"-i")==0)&&(i+1<argc)) {
inst.append(argv[++i]);
}
else if (0==stricmp(argv[i],"-f")) {
forceGroupUpdate = true;
}
else if ((stricmp(argv[i],"-d")==0)&&(i+3<argc)) {
dcat.append(argv[++i]);
dcomp.append(argv[++i]);
dinst.append(argv[++i]);
}
else if ((stricmp(argv[i],"-ip")==0)&&(i+1<argc)) {
dip.append(argv[++i]);
}
else {
usage(argv[0]);
return -1;
}
}
else {
if (filename.length()) {
usage(argv[0]);
return -1;
}
filename.append(argv[i]);
}
}
Owned<IPropertyTree> env;
try {
env.setown(createPTreeFromXMLFile(argv[1]));
if (!env.get()) {
fprintf(stderr,"Could not load Environment from %s\n",argv[1]);
return 1;
}
const char *s = env->queryName();
if (!s||(strcmp(s,"Environment")!=0)) {
fprintf(stderr,"File %s is invalid\n",argv[1]);
return 1;
}
}
catch (IException *e) {
StringBuffer err;
e->errorMessage(err);
fprintf(stderr,"Could not load Environment from %s, %s\n",argv[1],err.str());
return 1;
}
int ret = 0;
try {
if (dcat.length()) {
IPropertyTree* dirs = env->queryPropTree("Software/Directories");
StringBuffer dirout;
if (getConfigurationDirectory(dirs,dcat.str(),dcomp.str(),dinst.str(),dirout)&&dirout.length()) {
if (dip.length()) {
SocketEndpoint ep(dip.str());
RemoteFilename rfn;
rfn.setPath(ep,dirout.str());
rfn.getRemotePath(dirout.clear());
}
printf("%s",dirout.str());
}
else {
ret = 1;
}
}
else {
if (!updateDaliEnv(env, forceGroupUpdate, inst.str()))
ret = 1;
}
}
catch (IException *e) {
pexception("updtdalienv",e);
e->Release();
ret = 1;
}
releaseAtoms();
return ret;
}