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


C++ DOMString::push_back方法代码示例

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


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

示例1: getNativePath

DOMString URI::getNativePath() const
{
    DOMString pathStr = toStr(path);
    DOMString npath;
#ifdef __WIN32__
    unsigned int firstChar = 0;
    if (pathStr.size() >= 3)
        {
        if (pathStr[0] == '/' &&
            uni_is_letter(pathStr[1]) &&
            pathStr[2] == ':')
            firstChar++;
         }
    for (unsigned int i=firstChar ; i<pathStr.size() ; i++)
        {
        XMLCh ch = (XMLCh) pathStr[i];
        if (ch == '/')
            npath.push_back((XMLCh)'\\');
        else
            npath.push_back(ch);
        }
#else
    npath = pathStr;
#endif
    return npath;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:26,代码来源:uri.cpp

示例2: substr

DOMString DOMString::substr(unsigned long start, unsigned long end) const
{
    DOMString ret;
    for (unsigned long i = start; i<end ; i++)
        ret.push_back(chars[i]);
    return ret;
}
开发者ID:step21,项目名称:inkscape-osx-packaging-native,代码行数:7,代码来源:domstring.cpp

示例3: toStr

static DOMString toStr(const std::vector<int> &arr)
{
    DOMString buf;
    std::vector<int>::const_iterator iter;
    for (iter=arr.begin() ; iter!=arr.end() ; ++iter)
        {
        int ch = *iter;
        if (isprint(ch))
            buf.push_back((XMLCh)ch);
        else
            {
            buf.push_back('%');
            int hi = ((ch>>4) & 0xf);
            buf.push_back(hexChars[hi]);
            int lo = ((ch   ) & 0xf);
            buf.push_back(hexChars[lo]);
            }
        }
    return buf;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:20,代码来源:uri.cpp

示例4: parseHierarchicalPart

int URI::parseHierarchicalPart(int p0)
{
    int p = p0;
    int ch;

    //# Authority field (host and port, for example)
    int p2 = match(p, "//");
    if (p2 > p)
        {
        p = p2;
        portSpecified = false;
        DOMString portStr;
        while (p < parselen)
            {
            ch = peek(p);
            if (ch == '/')
                break;
            else if (ch == '&') //IRI entity
                {
                int val;
                p2 = parseEntity(p, val);
                if (p2<p)
                    {
                    return -1;
                    }
                p = p2;
                authority.push_back((XMLCh)val);
                }
            else if (ch == '%') //ascii hex excape
                {
                int val;
                p2 = parseAsciiEntity(p, val);
                if (p2<p)
                    {
                    return -1;
                    }
                p = p2;
                authority.push_back((XMLCh)val);
                }
            else if (ch == ':')
                {
                portSpecified = true;
                p++;
                }
            else if (portSpecified)
                {
                portStr.push_back((XMLCh)ch);
                p++;
                }
            else
                {
                authority.push_back((XMLCh)ch);
                p++;
                }
            }
        if (portStr.size() > 0)
            {
            char *pstr = (char *)portStr.c_str();
            char *endStr;
            long val = strtol(pstr, &endStr, 10);
            if (endStr > pstr) //successful parse?
                port = val;
            }
        }

    //# Are we absolute?
    ch = peek(p);
    if (uni_is_letter(ch) && peek(p+1)==':')
        {
        absolute = true;
        path.push_back((XMLCh)'/');
        }
    else if (ch == '/')
        {
        absolute = true;
        if (p>p0) //in other words, if '/' is not the first char
            opaque = true;
        path.push_back((XMLCh)ch);
        p++;
        }

    while (p < parselen)
        {
        ch = peek(p);
        if (ch == '?' || ch == '#')
            break;
        else if (ch == '&') //IRI entity
            {
            int val;
            p2 = parseEntity(p, val);
            if (p2<p)
                {
                return -1;
                }
            p = p2;
            path.push_back((XMLCh)val);
            }
        else if (ch == '%') //ascii hex excape
            {
            int val;
//.........这里部分代码省略.........
开发者ID:Spin0za,项目名称:inkscape,代码行数:101,代码来源:uri.cpp


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