当前位置: 首页>>代码示例>>C++>>正文


C++ CharString::concata方法代码示例

本文整理汇总了C++中CharString::concata方法的典型用法代码示例。如果您正苦于以下问题:C++ CharString::concata方法的具体用法?C++ CharString::concata怎么用?C++ CharString::concata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CharString的用法示例。


在下文中一共展示了CharString::concata方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: callDirectory

// Set the Current variable to the current directory.
void FileSystem::callDirectory(CharString location) {
    if(location.Compare("..",2)) {
        if(Current->Parent != 0x0) {
            Current = Current->Parent;
        }
    } else {
        FileStructureNode* node = getNodeFromString(location);
        if(node != 0x0) {
            if(node->type == Directory) {
                Current = node;
            } else {
                // throw error!
                CharString cs = CharString("cd: ");
                cs.concata(location);
                cs.concata(": not a directory",17);
                this->ErrorString = cs.get();
                throw 10;
            }
        } else {
            // throw error!
            CharString cs = CharString("cd: ");
            cs.concata(location);
            cs.concata(": directory does not exist",26);
            this->ErrorString = cs.get();
            throw 9;
        }
    }
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: getModFileData

// within zip file or folder?
CharString APIMod::getModFileData(CharString modfile){
    // only support folders here, use inheritance to load zip files

    if(isfolder){
        CharString filex = file.clone();
        filex.concata("/");
        filex.concata(modfile);
        cout << "Reading mod folder file: " << filex << endl;
        return fileReadAll(filex);
    }else{
        cout << "could not open Mod File Data " << modfile << endl;
    }
}
开发者ID:EterniaLogic,项目名称:EterniaLibrary,代码行数:14,代码来源:APIMod.cpp

示例3: removeDir

// Removes a directory from the current directory based on location.
// Input: String location
void FileSystem::removeDir(CharString location) {
    FileStructureNode* node = getNodeFromString(location);
    if(node != 0x0 && node != Root) {
        // type-dir
        if(node->type == Directory) {
            // determine if CD is inside this dir.
            bool isCD = false;
            if(node->Child != 0x0) {
                FileStructureNode* cc = node->Child;
                while(cc != 0x0 && !isCD) {
                    // search through all of the relatives.
                    if(cc == Current) {
                        isCD = true;
                        break;
                    } else if(cc->Sibling != 0x0) {
                        FileStructureNode* ccd = cc->Sibling;
                        while(ccd != 0x0) {
                            if(ccd == Current) {
                                isCD=true;
                                break;
                            }
                            ccd = ccd->Sibling;
                        }
                    }
                    cc = cc->Child;
                }
            } else if(node == Current) {
                isCD = true;
            }


            if(!isCD) {
                node->del();
            } else {
                // this is restricted by call directory
                CharString cs = CharString("rmdir: ");
                cs.concata(location);
                cs.concata(": directory cannot be deleted",29);
                this->ErrorString = cs.get();
                throw 15;
            }

        } else {
            // cannot find!
            CharString cs = CharString("rmdir: ");
            cs.concata(location);
            cs.concata(": directory does not exist",26);
            this->ErrorString = cs.get();
            throw 8;
        }
    } else {
        // throw error!
        CharString cs = CharString("rmdir: ");
        cs.concata(location);
        cs.concata(": directory does not exist",26);
        this->ErrorString = cs.get();
        throw 7;
    }
}
开发者ID:,项目名称:,代码行数:61,代码来源:

示例4: removeFile

// Desc: Removes a file from the current directory based on location.
// Input: String location
void FileSystem::removeFile(CharString location) {
    FileStructureNode* node = getNodeFromString(location);
    if(node != 0x0) { // is node available?
        if(node->type == File) { // is node a file?
            // directly delete file.
            node->del();
        } else { // else throw DNE error
            CharString cs = CharString("rm: ");
            cs.concata(location);
            cs.concata(": file does not exist",21);
            this->ErrorString = cs.get();
            throw 6;
        }
    } else { // else throw DNE error
        // throw error!
        CharString cs = CharString("rm: ");
        cs.concata(location);
        cs.concata(": file does not exist",21);
        this->ErrorString = cs.get();
        throw 5;
    }
}
开发者ID:,项目名称:,代码行数:24,代码来源:


注:本文中的CharString::concata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。