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

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

?? win32platformutils.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright 1999-2002,2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Id: Win32PlatformUtils.cpp,v 1.25 2004/09/08 13:56:43 peiyongz Exp $ */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <xercesc/util/Janitor.hpp>#include <xercesc/util/PlatformUtils.hpp>#include <xercesc/util/RuntimeException.hpp>#include <xercesc/util/XMLExceptMsgs.hpp>#include <xercesc/util/XMLString.hpp>#include <xercesc/util/XMLUniDefs.hpp>#include <xercesc/util/XMLUni.hpp>#include <xercesc/util/PanicHandler.hpp>#include <windows.h>#include <stdio.h>#include <stdlib.h>#ifdef _DEBUG #ifdef _MSC_VER    #include <crtdbg.h> #else    #include <assert.h> #endif#endif////  These control which transcoding service is used by the Win32 version.//  They allow this to be controlled from the build process by just defining//  one of these values.//#if defined (XML_USE_ICU_TRANSCODER)    #include <xercesc/util/Transcoders/ICU/ICUTransService.hpp>#elif defined (XML_USE_WIN32_TRANSCODER)    #include <xercesc/util/Transcoders/Win32/Win32TransService.hpp>#elif defined (XML_USE_CYGWIN_TRANSCODER)    #include <xercesc/util/Transcoders/Cygwin/CygwinTransService.hpp>#else    #error A transcoding service must be chosen#endif////  These control which message loading service is used by the Win32 version.//  They allow this to be controlled from the build process by just defining//  one of these values.//#if defined (XML_USE_INMEM_MESSAGELOADER)    #include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp>#elif defined (XML_USE_WIN32_MSGLOADER)    #include <xercesc/util/MsgLoaders/Win32/Win32MsgLoader.hpp>#elif defined(XML_USE_ICU_MESSAGELOADER)    #include <xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp>#else    #error A message loading service must be chosen#endif////  These control which network access service is used by the Win32 version.//  They allow this to be controlled from the build process by just defining//  one of these values.//#if defined (XML_USE_NETACCESSOR_LIBWWW)    #include <xercesc/util/NetAccessors/libWWW/LibWWWNetAccessor.hpp>#elif defined (XML_USE_NETACCESSOR_WINSOCK)    #include <xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp>#endifXERCES_CPP_NAMESPACE_BEGIN// ---------------------------------------------------------------------------//  Local data////  gOnNT//      We figure out during init if we are on NT or not. If we are, then//      we can avoid a lot of transcoding in our system services stuff.// ---------------------------------------------------------------------------static bool     gOnNT;// ---------------------------------------------------------------------------//  XMLPlatformUtils: The panic method// ---------------------------------------------------------------------------void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason){    fgUserPanicHandler? fgUserPanicHandler->panic(reason) : fgDefaultPanicHandler->panic(reason);	}// ---------------------------------------------------------------------------//  XMLPlatformUtils: File Methods// ---------------------------------------------------------------------------////  Functions to look for Unicode forward and back slashes.//  This operation is complicated by the fact that some Japanese and Korean//    encodings use the same encoding for both '\' and their currency symbol//    (Yen or Won).  In these encodings, which is meant is context dependent.//    Unicode converters choose the currency symbols.  But in the context//    of a Windows file name, '\' is generally what was intended.////    So we make a leap of faith, and assume that if we get a Yen or Won//    here, in the context of a file name, that it originated in one of//    these encodings, and is really supposed to be a '\'.//static bool isBackSlash(XMLCh c) {    return c == chBackSlash ||           c == chYenSign   ||           c == chWonSign;}unsigned int XMLPlatformUtils::curFilePos(FileHandle theFile                                          , MemoryManager* const manager){    // Get the current position    const unsigned int curPos = ::SetFilePointer(theFile, 0, 0, FILE_CURRENT);    if (curPos == 0xFFFFFFFF)        ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetCurPos, manager);    return curPos;}void XMLPlatformUtils::closeFile(FileHandle theFile                                 , MemoryManager* const manager){    if (!::CloseHandle(theFile))        ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile, manager);}unsigned int XMLPlatformUtils::fileSize(FileHandle theFile                                        , MemoryManager* const manager){    // Get the current position    const unsigned int curPos = ::SetFilePointer(theFile, 0, 0, FILE_CURRENT);    if (curPos == 0xFFFFFFFF)        ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetCurPos, manager);    // Seek to the end and save that value for return    const unsigned int retVal = ::SetFilePointer(theFile, 0, 0, FILE_END);    if (retVal == 0xFFFFFFFF)        ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotSeekToEnd, manager);    // And put the pointer back    if (::SetFilePointer(theFile, curPos, 0, FILE_BEGIN) == 0xFFFFFFFF)        ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotSeekToPos, manager);    return retVal;}FileHandle XMLPlatformUtils::openFile(const char* const fileName                                      , MemoryManager* const manager){    FileHandle retVal = ::CreateFileA    (        fileName        , GENERIC_READ        , FILE_SHARE_READ        , 0        , OPEN_EXISTING        , FILE_FLAG_SEQUENTIAL_SCAN        , 0    );    if (retVal == INVALID_HANDLE_VALUE)        return 0;    return retVal;}FileHandle XMLPlatformUtils::openFile(const XMLCh* const fileName                                      , MemoryManager* const manager){    // Watch for obvious wierdness    if (!fileName)        return 0;    //    //  We have to play a little trick here. If its /x:.....    //  style fully qualified path, we have to toss the leading /    //  character.    //    const XMLCh* nameToOpen = fileName;    if (*fileName == chForwardSlash)    {        if (XMLString::stringLen(fileName) > 3)        {            if (*(fileName + 2) == chColon)            {                const XMLCh chDrive = *(fileName + 1);                if (((chDrive >= chLatin_A) && (chDrive <= chLatin_Z))                ||  ((chDrive >= chLatin_a) && (chDrive <= chLatin_z)))                {                    nameToOpen = fileName + 1;                }            }            // Similarly for UNC paths            if ( *(fileName + 1) == *(fileName + 2) &&                 (*(fileName + 1) == chForwardSlash ||                  *(fileName + 1) == chBackSlash) )            {                nameToOpen = fileName + 1;            }        }    }    //  Ok, this might look stupid but its a semi-expedient way to deal    //  with a thorny problem. Shift-JIS and some other Asian encodings    //  are fundamentally broken and map both the backslash and the Yen    //  sign to the same code point. Transcoders have to pick one or the    //  other to map '\' to Unicode and tend to choose the Yen sign.    //    //  Unicode Yen or Won signs as directory separators will fail.    //    //  So, we will check this path name for Yen or won signs and, if they are    //  there, we'll replace them with slashes.    //    //  A further twist:  we replace Yen and Won with forward slashes rather    //   than back slashes.  Either form of slash will work as a directory    //   separator.  On Win 95 and 98, though, Unicode back-slashes may    //   fail to transode back to 8-bit 0x5C with some Unicode converters    //   to  some of the problematic code pages.  Forward slashes always    //   transcode correctly back to 8 bit char * form.    //    XMLCh *tmpUName = 0;    const XMLCh* srcPtr = nameToOpen;    while (*srcPtr)    {        if (*srcPtr == chYenSign ||            *srcPtr == chWonSign)            break;        srcPtr++;    }    //    //  If we found a yen, then we have to create a temp file name. Else    //  go with the file name as is and save the overhead.    //    if (*srcPtr)    {        tmpUName = XMLString::replicate(nameToOpen, manager);        XMLCh* tmpPtr = tmpUName;        while (*tmpPtr)        {            if (*tmpPtr == chYenSign ||                *tmpPtr == chWonSign)                *tmpPtr = chForwardSlash;            tmpPtr++;        }        nameToOpen = tmpUName;    }    FileHandle retVal = 0;    if (gOnNT)    {        retVal = ::CreateFileW            (            (LPCWSTR) nameToOpen            , GENERIC_READ            , FILE_SHARE_READ            , 0            , OPEN_EXISTING            , FILE_FLAG_SEQUENTIAL_SCAN            , 0            );    }    else    {        //        //  We are Win 95 / 98.  Take the Unicode file name back to (char *)        //    so that we can open it.        //        char* tmpName = XMLString::transcode(nameToOpen, manager);        retVal = ::CreateFileA            (            tmpName            , GENERIC_READ            , FILE_SHARE_READ            , 0            , OPEN_EXISTING            , FILE_FLAG_SEQUENTIAL_SCAN            , 0            );        manager->deallocate(tmpName);//delete [] tmpName;    }    if (tmpUName)        manager->deallocate(tmpUName);//delete [] tmpUName;    if (retVal == INVALID_HANDLE_VALUE)        return 0;    return retVal;}FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName                                             , MemoryManager* const manager){    FileHandle retVal = ::CreateFileA    (        fileName        , GENERIC_WRITE        , 0              // no shared write        , 0        , CREATE_ALWAYS        , FILE_ATTRIBUTE_NORMAL        , 0    );    if (retVal == INVALID_HANDLE_VALUE)        return 0;    return retVal;}FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName                                             , MemoryManager* const manager){    // Watch for obvious wierdness    if (!fileName)        return 0;    //  Ok, this might look stupid but its a semi-expedient way to deal    //  with a thorny problem. Shift-JIS and some other Asian encodings    //  are fundamentally broken and map both the backslash and the Yen    //  sign to the same code point. Transcoders have to pick one or the    //  other to map '\' to Unicode and tend to choose the Yen sign.    //    //  Unicode Yen or Won signs as directory separators will fail.    //    //  So, we will check this path name for Yen or won signs and, if they are    //  there, we'll replace them with slashes.    //    //  A further twist:  we replace Yen and Won with forward slashes rather    //   than back slashes.  Either form of slash will work as a directory    //   separator.  On Win 95 and 98, though, Unicode back-slashes may    //   fail to transode back to 8-bit 0x5C with some Unicode converters    //   to  some of the problematic code pages.  Forward slashes always    //   transcode correctly back to 8 bit char * form.    //    XMLCh *tmpUName = 0;    const XMLCh *nameToOpen = fileName;    const XMLCh* srcPtr = fileName;    while (*srcPtr)    {        if (*srcPtr == chYenSign ||            *srcPtr == chWonSign)            break;        srcPtr++;    }    //    //  If we found a yen, then we have to create a temp file name. Else    //  go with the file name as is and save the overhead.    //    if (*srcPtr)    {        tmpUName = XMLString::replicate(fileName, manager);        XMLCh* tmpPtr = tmpUName;        while (*tmpPtr)        {            if (*tmpPtr == chYenSign ||                *tmpPtr == chWonSign)                *tmpPtr = chForwardSlash;            tmpPtr++;        }        nameToOpen = tmpUName;    }    FileHandle retVal = 0;    if (gOnNT)    {        retVal = ::CreateFileW            (            (LPCWSTR) nameToOpen            , GENERIC_WRITE            , 0              // no shared write            , 0            , CREATE_ALWAYS            , FILE_ATTRIBUTE_NORMAL            , 0            );    }    else    {        //        //  We are Win 95 / 98.  Take the Unicode file name back to (char *)        //    so that we can open it.        //        char* tmpName = XMLString::transcode(nameToOpen, manager);        retVal = ::CreateFileA            (            tmpName            , GENERIC_WRITE            , 0              // no shared write            , 0            , CREATE_ALWAYS            , FILE_ATTRIBUTE_NORMAL            , 0            );        manager->deallocate(tmpName);//delete [] tmpName;    }    if (tmpUName)        manager->deallocate(tmpUName);//delete [] tmpUName;    if (retVal == INVALID_HANDLE_VALUE)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线视频| 亚洲高清免费观看高清完整版在线观看 | 精品福利二区三区| 日韩欧美一二区| 7777精品久久久大香线蕉| 欧美日韩一区二区电影| 欧美日本乱大交xxxxx| 欧美人妇做爰xxxⅹ性高电影 | 卡一卡二国产精品| 久久国产尿小便嘘嘘| 国产综合一区二区| 成人在线综合网| 欧美性猛片xxxx免费看久爱 | 国产在线视频一区二区| 精品亚洲国产成人av制服丝袜| 国产一区二区日韩精品| 成人免费看视频| 欧美综合一区二区| 日韩午夜小视频| 中文欧美字幕免费| 亚洲国产毛片aaaaa无费看| 麻豆精品一区二区三区| 成人免费观看视频| 91.com视频| 中文字幕第一区综合| 亚洲综合在线第一页| 国产毛片精品视频| 色婷婷av一区二区三区之一色屋| 在线观看91精品国产麻豆| 久久精品一区四区| 亚洲一区在线观看免费观看电影高清| 日日欢夜夜爽一区| 成人h动漫精品一区二区| 欧美自拍丝袜亚洲| 久久综合狠狠综合久久综合88| 亚洲色图在线看| 国产精品主播直播| 欧美年轻男男videosbes| 国产精品剧情在线亚洲| 日韩成人午夜电影| 色94色欧美sute亚洲线路一ni| 亚洲精品在线观看网站| 亚洲一区在线电影| 成人app在线| 日韩欧美国产一区在线观看| 亚洲欧美日韩国产手机在线 | av电影在线观看完整版一区二区| 欧美精品免费视频| 亚洲美女一区二区三区| 国内成+人亚洲+欧美+综合在线| 欧洲精品一区二区三区在线观看| 日本一区二区三区在线不卡| 日韩av一二三| 欧美三日本三级三级在线播放| 中文字幕国产一区二区| 青青草国产精品亚洲专区无| 一本色道亚洲精品aⅴ| 中文字幕欧美三区| 国产夫妻精品视频| 欧美精品一区二区三区在线播放| 丝袜亚洲另类丝袜在线| 在线视频国内自拍亚洲视频| 成人欧美一区二区三区白人| 国产寡妇亲子伦一区二区| 欧美不卡一区二区三区四区| 丝袜脚交一区二区| 在线一区二区三区做爰视频网站| ●精品国产综合乱码久久久久 | 欧美日韩一区在线| 亚洲成人在线免费| 欧美日韩一区二区三区四区| 一区二区三区在线观看国产| 色哟哟国产精品| 亚洲久草在线视频| 欧美图区在线视频| 日韩精品色哟哟| 日韩欧美一区中文| 狠狠狠色丁香婷婷综合激情 | 亚洲夂夂婷婷色拍ww47| 一本大道久久a久久精二百| 亚洲伦在线观看| 欧美伊人久久大香线蕉综合69| 亚洲精品视频在线看| 91国偷自产一区二区三区观看| 亚洲乱码中文字幕| 欧美另类久久久品| 精品一区二区三区在线视频| 久久精品亚洲国产奇米99| 成人高清免费在线播放| 亚洲色大成网站www久久九九| 在线免费观看日韩欧美| 日日夜夜精品视频免费| 久久综合九色综合欧美98| 99久久国产免费看| 婷婷夜色潮精品综合在线| 日韩欧美国产午夜精品| 高清国产一区二区三区| 一区二区免费在线| 日韩精品一区二区三区视频| 国产69精品久久久久毛片| 一区二区免费看| 日韩欧美国产电影| 成人av资源在线| 视频一区免费在线观看| 国产亚洲欧美激情| 色激情天天射综合网| 老司机免费视频一区二区| 国产精品久久久久9999吃药| 欧美午夜电影网| 国产精品资源在线| 亚洲777理论| 亚洲欧洲三级电影| 欧美一区二区三区免费视频| 国产成人综合视频| 午夜国产精品影院在线观看| 中文成人综合网| 91精品福利在线一区二区三区 | 激情久久久久久久久久久久久久久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 色综合久久久久| 国产毛片精品一区| 婷婷一区二区三区| 自拍偷拍国产精品| 久久美女艺术照精彩视频福利播放| 一本大道av伊人久久综合| 国产一级精品在线| 日韩中文字幕区一区有砖一区 | 日韩一卡二卡三卡| 欧洲精品在线观看| www.日韩精品| 国产麻豆成人传媒免费观看| 午夜私人影院久久久久| 国产精品美女一区二区三区 | 99精品在线免费| 风间由美一区二区av101| 青草国产精品久久久久久| 亚洲第一福利一区| 亚洲免费观看高清完整版在线观看 | 成人午夜精品在线| 国内外成人在线| 黄网站免费久久| 久久国产精品99久久人人澡| 天天影视涩香欲综合网| 亚洲最快最全在线视频| 1024亚洲合集| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日本不卡视频在线| 日韩电影免费在线看| 日韩中文字幕亚洲一区二区va在线| 亚洲精品国产品国语在线app| 亚洲欧洲精品一区二区三区| 国产精品九色蝌蚪自拍| 国产精品久久久久久久蜜臀| 中文字幕一区二区三区在线播放| 亚洲欧洲精品天堂一级| 亚洲精品一卡二卡| 夜夜精品浪潮av一区二区三区| 亚洲午夜激情av| 日本最新不卡在线| 九九**精品视频免费播放| 精品无人区卡一卡二卡三乱码免费卡 | 日本特黄久久久高潮| 久久精品国产999大香线蕉| 蜜臀a∨国产成人精品| 久久精品理论片| 国产成人在线电影| 91在线观看地址| 精品视频一区二区不卡| 911精品国产一区二区在线| 欧美成人精品福利| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 亚洲国产视频在线| 久久99精品国产.久久久久| 国产激情视频一区二区在线观看| eeuss影院一区二区三区| 在线免费亚洲电影| 精品国产免费人成电影在线观看四季| 中文子幕无线码一区tr| 亚洲美女电影在线| 久久精品国产第一区二区三区| 国产成人8x视频一区二区 | 亚洲精品一区二区三区福利| 中文字幕一区av| 欧美aⅴ一区二区三区视频| 国产91富婆露脸刺激对白| 欧美日韩亚洲国产综合| 久久久亚洲综合| 亚洲一区二区三区爽爽爽爽爽| 国产在线一区二区综合免费视频| 91福利国产精品| 国产视频一区二区在线| 亚洲成a天堂v人片| 不卡高清视频专区| 欧美电影免费观看高清完整版在| 18成人在线观看| 精品在线播放免费| 欧美欧美欧美欧美| 亚洲三级视频在线观看| 国产一区二区精品久久91| 欧美日韩卡一卡二|