예제 #1
0
void CEspBinding::getNavigationData(IEspContext &context, IPropertyTree & data)
{
    IEspWsdlSections *wsdl = dynamic_cast<IEspWsdlSections *>(this);
    if (wsdl)
    {
        StringBuffer serviceName, params;
        wsdl->getServiceName(serviceName);
        if (!getUrlParams(context.queryRequestParameters(), params))
        {
            if (context.getClientVersion()>0)
                params.appendf("%cver_=%g", params.length()?'&':'?', context.getClientVersion());
        }

        StringBuffer encodedparams;
        if (params.length())
            encodeUtf8XML(params.str(), encodedparams, 0);

        if (params.length())
            params.setCharAt(0,'&'); //the entire params string will follow the initial param: "?form"

        VStringBuffer folderpath("Folder[@name='%s']", serviceName.str());

        IPropertyTree *folder = data.queryPropTree(folderpath.str());
        if(!folder)
        {
            folder=createPTree("Folder");
            folder->addProp("@name", serviceName.str());
            folder->addProp("@info", serviceName.str());
            folder->addProp("@urlParams", encodedparams);
            if (showSchemaLinks())
                folder->addProp("@showSchemaLinks", "true");
            folder->addPropBool("@isDynamicBinding", isDynamicBinding());
            folder->addPropBool("@isBound", isBound());
            data.addPropTree("Folder", folder);
        }

        MethodInfoArray methods;
        wsdl->getQualifiedNames(context, methods);
        ForEachItemIn(idx, methods)
        {
            CMethodInfo &method = methods.item(idx);
            IPropertyTree *link=createPTree("Link");
            link->addProp("@name", method.m_label.str());
            link->addProp("@info", method.m_label.str());
            StringBuffer path;
            path.appendf("../%s/%s?form%s", serviceName.str(), method.m_label.str(),params.str());
            link->addProp("@path", path.str());

            folder->addPropTree("Link", link);
        }
    }
예제 #2
0
파일: folder.cpp 프로젝트: stonerl/client
int Folder::slotDiscardDownloadProgress()
{
    // Delete from journal and from filesystem.
    QDir folderpath(_definition.localPath);
    QSet<QString> keep_nothing;
    const QVector<SyncJournalDb::DownloadInfo> deleted_infos =
            _journal.getAndDeleteStaleDownloadInfos(keep_nothing);
    foreach (const SyncJournalDb::DownloadInfo & deleted_info, deleted_infos) {
        const QString tmppath = folderpath.filePath(deleted_info._tmpfile);
        qDebug() << "Deleting temporary file: " << tmppath;
        QFile::remove(tmppath);
    }
    return deleted_infos.size();
}
예제 #3
0
bool DirList::LoadPath(const std::string & folder, const char *filter, u32 flags)
{
	if(folder.empty()) return false;

	Flags = flags;
	Filter = filter;

	std::string folderpath(folder);
	u32 length = folderpath.size();

	//! clear path of double slashes
	RemoveDoubleSlashs(folderpath);

	//! remove last slash if exists
	if(length > 0 && folderpath[length-1] == '/')
		folderpath.erase(length-1);

	return InternalLoadPath(folderpath);
}