Esempio n. 1
0
vec_string& GetCPPFILES()
{
    static vec_string vCPP;
    vCPP.push_back("cpp");
    vCPP.push_back("c");
    vCPP.push_back("cxx");

    return vCPP;
}
Esempio n. 2
0
void GetHeaderFileIn(const string &str, vec_string &v)
{
    try {
        string::size_type pos = str.find("#");
        if (string::npos == pos) {
            return;
        }

        pos = str.find("include", pos + 1);
        if (string::npos == pos) {
            return;
        }

        pos = str.find("\"", pos + 7);
        if (string::npos == pos) {
            return;
        }

        string::size_type posEnd = str.find("\"", pos + 1);
        if (string::npos == posEnd) {
            return;
        }

        v.push_back(str.substr(pos + 1, posEnd - pos - 1));
    }
    catch (exception) {

    }
}
Esempio n. 3
0
void GetCurrDirFiles(vec_string &v)
{
    DIR     *dirp;
    struct  dirent *dp;

    if ((dirp = opendir(".")) != NULL) {
        while ((dp = readdir(dirp)) != NULL) {
            v.push_back(dp->d_name);
        }
        closedir(dirp);
    }
}
Esempio n. 4
0
void GetCurrDirFiles(vec_string &v)
{
    enum { SZ_SIZE = 1024 };

    char szBuff[SZ_SIZE + 1];
    GetCurrentDirectory(SZ_SIZE, szBuff);

    string str = szBuff;
    str += "\\*";

    WIN32_FIND_DATA wfd = {0};
    HANDLE h = FindFirstFile(str.c_str(), &wfd);

    while (FindNextFile(h, &wfd)) {
        v.push_back(wfd.cFileName);
    }

    FindClose(h);
}