zoukankan      html  css  js  c++  java
  • bool CreatedMultipleDirectory( char* direct)

    bool CreatedMultipleDirectory( char* direct)
    {
        string Directoryname = direct;
        if (  Directoryname[Directoryname.length() - 1] !=  '\\' )
        {
            //Directoryname +=
            Directoryname.append( 1, '\\');
        }
        std::vector<string> vpath;
        string strtemp;
        bool  bSuccess = false;
        for ( int i = 0; i < Directoryname.length(); i++ )
        {
            if ( Directoryname[i] != '\\')
            {
                strtemp.append( 1,Directoryname[i] );   
            }
            else
            {
                vpath.push_back( strtemp );
                strtemp.append( 1, '\\' );
            }
        }
        std::vector<string>:: const_iterator vIter;
        for ( vIter = vpath.begin();vIter != vpath.end(); vIter++ )
        {
            bSuccess = CreateDirectory( vIter->c_str(), NULL ) ? true :false;
        }
        return bSuccess;
    }

    Technorati Tags: MFC Windows ansi
  • 相关阅读:
    04-JQuery
    03-JavaScript
    02-CSS&JS
    01-HTML
    [LeetCode]Insert Interval
    [shell编程]正则表达式
    [LeetCode]Jump Game II
    [LeetCode]Jump Game
    [LeetCode]Wildcard Matching
    [shell编程]初识sed和gawk
  • 原文地址:https://www.cnblogs.com/maifengqiang/p/2055193.html
Copyright © 2011-2022 走看看