亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? npathstring.h

?? 奇跡世界公用文件源代碼,研究網絡游戲的朋友可以研究下
?? H
字號:
#ifndef N_PATHSTRING_H
#define N_PATHSTRING_H
//------------------------------------------------------------------------------
/**
    @ 版肺 汲瀝 膠飄傅 努貳膠 

    @author
    - RadonLabs GmbH 

    @since
    - 2005.6.14
    @remarks
    - 瘤肯 眠啊 
*/
//------------------------------------------------------------------------------


#include "Nstring.h"

class nPathString : public nString
{
public:
    /// default constructor
    nPathString();
    /// constructor 1
    nPathString(const char*str);
    /// copy constructor
    nPathString(const nPathString& rhs);
    /// = operator
    nPathString& operator=(const nPathString& rhs);
    /// = operator with string
    nPathString& operator=(const char* rhs);

    /// get pointer to extension (without the dot)
    const char* GetExtension() const;
    /// check if extension matches (no dot in the extension!)
    bool CheckExtension(const char* ext) const;
    /// convert backslashes to slashes
    void ConvertBackslashes();
    /// remove extension
    void StripExtension();
    /// extract the part after the last directory separator
    nPathString ExtractFileName() const;
    /// extract the last directory of the path
    nPathString ExtractLastDirName() const;
    /// extract the part before the last directory separator
    nPathString ExtractDirName() const;
    /// strip slash at end of path, if exists
    void StripTrailingSlash();
    /// extract path until last slash
    nPathString ExtractToLastSlash() const;

private:
    /// get pointer to last directory separator
    char* GetLastSlash() const;
};

//------------------------------------------------------------------------------
/**
*/
inline
nPathString::nPathString() :
    nString()
{
    // empty
}

//------------------------------------------------------------------------------
/**
*/
inline
nPathString::nPathString(const char* str) :
    nString(str)
{
    // empty
}

//------------------------------------------------------------------------------
/**
*/
inline
nPathString::nPathString(const nPathString& rhs) :
    nString()
{
    this->Copy(rhs);
}

//------------------------------------------------------------------------------
/**
*/
inline
nPathString&
nPathString::operator=(const nPathString& rhs)
{
    this->Delete();
    this->Copy(rhs);
    return *this;
}

//------------------------------------------------------------------------------
/**
    06-Jan-03   floh    renamed to something more intuitive
*/
inline
void
nPathString::ConvertBackslashes()
{
    const char* ptr;
    if (this->string)
    {
        ptr = this->string;
    }
    else if (this->localString[0])
    {
        ptr = this->localString;
    }
    else
    {
        return;
    }

    char *buf = new char[this->strLen + 1];

    for (int i = 0; i <= this->strLen; i++)
    {
        buf[i] = (ptr[i] == '\\') ? '/' : ptr[i];
    }
    this->Set(buf);
    delete[] buf;
}

//------------------------------------------------------------------------------
/**
*/
inline
nPathString&
nPathString::operator=(const char* rhs)
{
    this->Set(rhs);
    return *this;
}

//------------------------------------------------------------------------------
/**
    @return     pointer to extension (without the dot), or 0
*/
inline
const char*
nPathString::GetExtension() const
{
    const char* str = this->Get();
    const char* ext = strrchr(str, '.');
    if (ext)
    {
        ext++;
        if (ext[0] != 0)
        {
            return ext;
        }
    }
    return 0;
}

//------------------------------------------------------------------------------
/**
    Returns true if file extension matches.

    @param  ext     extension string (without the dot)
    @return         true if extension matches
*/
inline
bool
nPathString::CheckExtension(const char* ext) const
{
    const char* extStr = this->GetExtension();
    if (0 == extStr)
    {
        return false;
    }
    return (0 == (strcmp(ext, extStr)));
}

//------------------------------------------------------------------------------
/**
    Strips last slash, if the path name ends on a slash.
*/
inline
void
nPathString::StripTrailingSlash()
{
    if (this->strLen > 0)
    {
        int pos = strLen - 1;
        char* str = (char*) this->Get();
        if ((str[pos] == '/') || (str[pos] == '\\'))
        {
            str[pos] = 0;
        }
    }
}

//------------------------------------------------------------------------------
/**
    Remove the file extension.
*/
inline
void
nPathString::StripExtension()
{
    char* ext = (char*) this->GetExtension();
    if (ext)
    {
        ext[-1] = 0;
    }
}

//------------------------------------------------------------------------------
/**
    Get a pointer to the last directory separator.
*/
inline
char*
nPathString::GetLastSlash() const
{
    char* s = (char*) this->Get();
    char* lastSlash = strrchr(s, '/');
    if (0 == lastSlash) lastSlash = strrchr(s, '\\');
    if (0 == lastSlash) lastSlash = strrchr(s, ':');
    return lastSlash;
}

//------------------------------------------------------------------------------
/**
    Return a nPathString object containing the part after the last
    path separator.
*/
inline
nPathString
nPathString::ExtractFileName() const
{
    nPathString pathString;
    char* lastSlash = this->GetLastSlash();
    if (lastSlash)
    {
        pathString = &(lastSlash[1]);
    }
    else
    {
        pathString = this->Get();
    }
    return pathString;
}

//------------------------------------------------------------------------------
/**
    Return a nPathString object containing the last directory of the path, i.e.
    a category.

    - 17-Feb-04     floh    fixed a bug when the path ended with a slash
*/
inline
nPathString
nPathString::ExtractLastDirName() const
{
    nPathString pathString(*this);
    char* lastSlash = pathString.GetLastSlash();

    // special case if path ends with a slash
    if (lastSlash)
    {
        if (0 == lastSlash[1])
        {
            *lastSlash = 0;
            lastSlash = pathString.GetLastSlash();
        }

        char* secLastSlash = 0;
        if (0 != lastSlash)
        {
            *lastSlash = 0; // cut filename
            secLastSlash = pathString.GetLastSlash();
            if (secLastSlash)
            {
                *secLastSlash = 0;
                return nPathString(secLastSlash+1);
            }
        }
    }
    return "";
}

//------------------------------------------------------------------------------
/**
    Return a nPathString object containing the part before the last
    directory separator.

    NOTE: I left my fix in that returns the last slash (or colon), this was
    necessary to tell if a dirname is a normal directory or an assign.

    - 17-Feb-04     floh    fixed a bug when the path ended with a slash
*/
inline
nPathString
nPathString::ExtractDirName() const
{
    nPathString pathString(*this);
    char* lastSlash = pathString.GetLastSlash();

    // special case if path ends with a slash
    if (lastSlash)
    {
        if (0 == lastSlash[1])
        {
            *lastSlash = 0;
            lastSlash = pathString.GetLastSlash();
        }
        if (lastSlash)
        {
            *++lastSlash = 0;
        }
    }
    return pathString;
}

//------------------------------------------------------------------------------
/**
    Return a path string object which contains of the complete path
    up to the last slash. Returns an empty string if there is no
    slash in the path.
*/
inline
nPathString
nPathString::ExtractToLastSlash() const
{
    nPathString pathString(*this);
    char* lastSlash = pathString.GetLastSlash();
    if (lastSlash)
    {
        lastSlash[1] = 0;
    }
    else
    {
        pathString = "";
    }
    return pathString;
}

//------------------------------------------------------------------------------
/**
*/
static
inline
nPathString
operator+(const nPathString& s0, const nPathString& s1)
{
    nPathString newString = s0;
    newString.Append(s1.Get());
    return newString;
}

//------------------------------------------------------------------------------
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久爱www久久做| 一区二区三区欧美视频| 精品视频一区二区三区免费| 欧美韩日一区二区三区| 北岛玲一区二区三区四区| 欧美三级日本三级少妇99| 久久久久9999亚洲精品| 国产精品夜夜嗨| 一区二区三区欧美久久| www国产成人免费观看视频 深夜成人网| 国产一区二区美女诱惑| 一级中文字幕一区二区| 欧美大片顶级少妇| 在线观看视频一区| 国产福利91精品一区二区三区| 国产精品18久久久久| 国产欧美精品一区二区色综合 | 欧美日韩国产一级| 国产一区三区三区| 蜜桃视频第一区免费观看| 最新日韩av在线| 欧美经典三级视频一区二区三区| 91福利资源站| 99热这里都是精品| 精品一区二区在线看| 亚洲男人的天堂av| 欧美电视剧免费全集观看| 国产suv一区二区三区88区| 国产精品久久久久一区| 91网站在线播放| 日本视频一区二区三区| 国产欧美日韩综合| 欧美三级在线看| caoporen国产精品视频| 国产suv精品一区二区883| 99精品1区2区| 91精品国产手机| 国产日本欧洲亚洲| 亚洲欧洲综合另类| √…a在线天堂一区| 欧美巨大另类极品videosbest | 26uuu欧美| 欧美久久婷婷综合色| 国产91在线观看丝袜| 日韩精品亚洲一区二区三区免费| 欧美国产一区在线| 欧美一级片在线观看| 欧美色视频在线| 成人h动漫精品一区二| 蜜臀av性久久久久蜜臀aⅴ四虎| 精品欧美黑人一区二区三区| 欧美天堂亚洲电影院在线播放| 麻豆极品一区二区三区| 免费人成精品欧美精品| 亚洲欧美日韩国产综合在线| 精品国产乱码久久久久久1区2区 | 日韩欧美国产系列| 欧美日韩三级一区二区| 欧美一级日韩一级| 久久亚洲一级片| 国产精品毛片无遮挡高清| 欧美经典一区二区三区| 一区二区三区四区五区视频在线观看| 亚洲另类在线一区| 日本va欧美va瓶| 成人免费黄色大片| 日韩一区二区三区精品视频| 欧美激情在线免费观看| 亚洲综合色在线| 国产一区二区h| 91精品办公室少妇高潮对白| 精品乱人伦一区二区三区| 亚洲色图另类专区| 激情久久五月天| 欧美色手机在线观看| 国产精品久久久久久久久免费樱桃| 亚洲午夜久久久久中文字幕久| 国内成+人亚洲+欧美+综合在线| 成人免费视频国产在线观看| 大美女一区二区三区| 精品一区二区三区在线播放| 欧美在线观看视频一区二区| 亚洲人成伊人成综合网小说| 91激情五月电影| 亚洲综合在线第一页| 欧美日韩国产综合视频在线观看 | 精品久久久久久久人人人人传媒| 日韩在线观看一区二区| 欧美老肥妇做.爰bbww视频| 欧美优质美女网站| 国产真实乱对白精彩久久| 欧美一区二区三区思思人| 一区二区三区日韩精品视频| 一本一道波多野结衣一区二区| 国产精品欧美一级免费| 丁香婷婷综合网| 欧美国产禁国产网站cc| 99热国产精品| 亚洲高清不卡在线| 日韩一区二区中文字幕| 国产麻豆成人精品| 国产精品久久久久久久久果冻传媒| 成人a级免费电影| 亚洲一区在线观看网站| 欧美一区二区三区白人| 国产在线精品视频| 亚洲欧美日韩在线不卡| 欧美一区二区视频网站| 国产美女精品人人做人人爽| 亚洲欧美国产高清| 91精品国产色综合久久不卡电影| 国产在线播放一区三区四| 亚洲精品久久久蜜桃| 精品国产sm最大网站| voyeur盗摄精品| 久久国产精品色| 亚洲免费在线播放| 久久久久国产免费免费| 欧美丰满嫩嫩电影| 暴力调教一区二区三区| 久久er精品视频| 亚洲一区二区欧美| 国产精品灌醉下药二区| 26uuu精品一区二区| 国产精品久久久久久福利一牛影视| 亚洲天堂2016| 亚洲欧美另类在线| 亚洲国产中文字幕| 日本亚洲电影天堂| 麻豆国产欧美日韩综合精品二区| 久久99精品一区二区三区三区| 麻豆91免费观看| 国产成人精品亚洲午夜麻豆| 丁香六月综合激情| 91色婷婷久久久久合中文| 欧美午夜影院一区| 欧美videos大乳护士334| 国产欧美综合在线| 亚洲一区二区中文在线| 蜜臀av一区二区三区| 从欧美一区二区三区| 欧美亚洲国产一区在线观看网站| 宅男噜噜噜66一区二区66| 久久久不卡网国产精品二区| 最新日韩av在线| 免费日本视频一区| 色狠狠色狠狠综合| 精品国产精品网麻豆系列| 亚洲三级久久久| 国产揄拍国内精品对白| 色av综合在线| 日本一区二区三区国色天香| 亚洲国产精品欧美一二99| 国产精一品亚洲二区在线视频| 色又黄又爽网站www久久| 精品国产百合女同互慰| 伊人色综合久久天天人手人婷| 国产精品一区二区91| 欧美性猛片xxxx免费看久爱| 欧美国产精品久久| 国产一区二区三区国产| 欧美午夜视频网站| 一区二区在线免费| 91视频免费看| 中文字幕日韩一区| www.激情成人| 国产精品久久久久9999吃药| 日韩在线观看一区二区| 麻豆91精品视频| 欧美日韩综合色| 中文字幕一区二区三区在线不卡| 日本中文字幕一区二区有限公司| 成人激情电影免费在线观看| 日韩精品一区二区三区在线| 午夜av电影一区| 欧美日韩在线精品一区二区三区激情 | 亚洲成a人片在线观看中文| 不卡高清视频专区| 国产精品日韩成人| 94-欧美-setu| 樱桃视频在线观看一区| 91国偷自产一区二区三区成为亚洲经典 | 久久新电视剧免费观看| 欧美aaa在线| 亚洲精品一区二区三区福利 | 亚洲视频综合在线| 97久久超碰国产精品电影| 国产精品成人午夜| 色综合欧美在线视频区| 一区二区三区鲁丝不卡| 欧美色视频一区| 午夜精品福利久久久| 欧美一区二区三区在| aaa亚洲精品| 另类成人小视频在线| 欧美xxxx在线观看| 欧美日本一道本| 日日噜噜夜夜狠狠视频欧美人| 精品国产乱码久久久久久1区2区| 成人18精品视频|