Ignore:
Timestamp:
Jan 13, 2007, 4:26:50 AM (17 years ago)
Author:
dai_9181
Message:

_System_LocalThis(見えないThisポインタパラメータ)を通常のパラメータ保有領域ではなく、リアルパラメータ保有領域に移動した。
メソッドとグローバル関数のオーバーロードに対応(DLL関数オーバーロードには未対応)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/StrOperation.cpp

    r15 r31  
    704704    return 0;
    705705}
     706
     707void ShortPathToLongPath(const char *ShortPath,char *LongPath){
     708    HANDLE hFind;
     709    WIN32_FIND_DATA wfd;
     710    int i;
     711    char dummy[MAX_PATH];
     712    for(i=0;i<MAX_PATH;i++){
     713        LongPath[i]=ShortPath[i];
     714        if((ShortPath[i-1]==':'&&ShortPath[i]=='\\')||(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\')){
     715            LongPath[i+1]=0;
     716            break;
     717        }
     718    }
     719    if(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\'){
     720        for(i++;i<MAX_PATH;i++){
     721            if(IsDBCSLeadByte(ShortPath[i])){
     722                i++;
     723                continue;
     724            }
     725            LongPath[i]=ShortPath[i];
     726            if(ShortPath[i]=='\\'){
     727                LongPath[i+1]=0;
     728                break;
     729            }
     730        }
     731        for(i++;i<MAX_PATH;i++){
     732            if(IsDBCSLeadByte(ShortPath[i])){
     733                i++;
     734                continue;
     735            }
     736            LongPath[i]=ShortPath[i];
     737            if(ShortPath[i]=='\\'){
     738                LongPath[i+1]=0;
     739                break;
     740            }
     741        }
     742    }
     743    for(i++;i<MAX_PATH;i++){
     744        if(IsDBCSLeadByte(ShortPath[i])){
     745            i++;
     746            continue;
     747        }
     748        if(ShortPath[i]=='\\'||ShortPath[i]=='\0'){
     749            strncpy(dummy,ShortPath,i);
     750            dummy[i]=0;
     751            if((hFind=FindFirstFile(dummy,&wfd))!=INVALID_HANDLE_VALUE) FindClose(hFind);
     752            lstrcat(LongPath,wfd.cFileName);
     753
     754            if(ShortPath[i]=='\0') break;
     755            lstrcat(LongPath,"\\");
     756
     757            if(ShortPath[i]=='\\'&&ShortPath[i+1]=='\0'){
     758                break;
     759            }
     760        }
     761    }
     762}
Note: See TracChangeset for help on using the changeset viewer.