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

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

?? xmldatetime.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/* * Copyright 2001-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: XMLDateTime.cpp,v 1.28 2004/09/08 13:56:24 peiyongz Exp $ * $Log: XMLDateTime.cpp,v $ * Revision 1.28  2004/09/08 13:56:24  peiyongz * Apache License Version 2.0 * * Revision 1.27  2004/09/02 15:03:50  peiyongz * To build on AIX * * Revision 1.26  2004/08/31 20:50:50  peiyongz * Parse/keep milisecond as double to retain precision. * * Revision 1.25  2004/01/29 11:48:47  cargilld * Code cleanup changes to get rid of various compiler diagnostic messages. * * Revision 1.24  2004/01/25 23:23:26  jberry * Step around CodeWarrior compiler warning * * Revision 1.23  2004/01/13 19:50:56  peiyongz * remove parseContent() * * Revision 1.22  2004/01/13 16:34:20  cargilld * Misc memory management changes. * * Revision 1.21  2004/01/03 00:03:18  peiyongz * parseContent * * Revision 1.20  2003/12/31 02:34:11  neilg * enable production of canonical representations for dates with negative years, or years >9999 * * Revision 1.19  2003/12/17 00:18:35  cargilld * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data. * * Revision 1.18  2003/12/16 22:48:52  peiyongz * exception thrown upon invalid number, thanks Gareth Reakes. * * Revision 1.17  2003/12/11 21:38:12  peiyongz * support for Canonical Representation for Datatype * * Revision 1.16  2003/09/25 22:24:28  peiyongz * Using writeString/readString * * Revision 1.15  2003/09/25 15:22:54  peiyongz * Solve HP complier error * * Revision 1.14  2003/09/23 18:16:07  peiyongz * Inplementation for Serialization/Deserialization * * Revision 1.13  2003/08/14 02:57:27  knoaman * Code refactoring to improve performance of validation. * * Revision 1.12  2003/05/22 02:10:52  knoaman * Default the memory manager. * * Revision 1.11  2003/05/18 14:02:05  knoaman * Memory manager implementation: pass per instance manager. * * Revision 1.10  2003/05/15 19:07:46  knoaman * Partial implementation of the configurable memory manager. * * Revision 1.9  2003/05/15 16:32:19  gareth * We did not allow dateTimes with a timezone due to the last seconds fix. * * Revision 1.8  2003/03/23 22:54:49  peiyongz * invalid second values * * Revision 1.7  2003/02/22 22:49:09  peiyongz * Schema Errata E2-45 24:00:00 allowed * * Revision 1.6  2003/02/02 23:54:43  peiyongz * getFormattedString() added to return original and converted value. * * Revision 1.5  2003/01/30 21:55:22  tng * Performance: create getRawData which is similar to toString but return the internal data directly, user is not required to delete the returned memory. * * Revision 1.4  2002/11/28 20:39:27  peiyongz * Schema Errata: E2-23 seconds part shall have at least one digit after the dot *                           if it appears. * * Revision 1.3  2002/11/06 22:22:21  peiyongz * Schema-Errata: E2-12: gMonth * * Revision 1.2  2002/11/04 15:22:05  tng * C++ Namespace Support. * * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz * sane_include * * Revision 1.4  2001/11/14 22:04:03  peiyongz * Patch to apply check on Year and more rigorous on other fields as well. * * Revision 1.3  2001/11/12 20:36:54  peiyongz * SchemaDateTimeException defined * * Revision 1.2  2001/11/09 20:41:45  peiyongz * Fix: compilation error on Solaris and AIX. * * Revision 1.1  2001/11/07 19:16:03  peiyongz * DateTime Port * * */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <stdlib.h>#include <assert.h>#include <errno.h>#include <xercesc/util/XMLDateTime.hpp>#include <xercesc/util/XMLString.hpp>#include <xercesc/util/XMLUni.hpp>#include <xercesc/util/Janitor.hpp>#include <xercesc/util/NumberFormatException.hpp>XERCES_CPP_NAMESPACE_BEGIN//// constants used to process raw data (fBuffer)//// [-]{CCYY-MM-DD}'T'{HH:MM:SS.MS}['Z']//                                [{+|-}hh:mm']//static const XMLCh DURATION_STARTER     = chLatin_P;              // 'P'static const XMLCh DURATION_Y           = chLatin_Y;              // 'Y'static const XMLCh DURATION_M           = chLatin_M;              // 'M'static const XMLCh DURATION_D           = chLatin_D;              // 'D'static const XMLCh DURATION_H           = chLatin_H;              // 'H'static const XMLCh DURATION_S           = chLatin_S;              // 'S'static const XMLCh DATE_SEPARATOR       = chDash;                 // '-'static const XMLCh TIME_SEPARATOR       = chColon;                // ':'static const XMLCh TIMEZONE_SEPARATOR   = chColon;                // ':'static const XMLCh DATETIME_SEPARATOR   = chLatin_T;              // 'T'static const XMLCh MILISECOND_SEPARATOR = chPeriod;               // '.'static const XMLCh UTC_STD_CHAR         = chLatin_Z;              // 'Z'static const XMLCh UTC_POS_CHAR         = chPlus;                 // '+'static const XMLCh UTC_NEG_CHAR         = chDash;                 // '-'static const XMLCh UTC_SET[]            = {UTC_STD_CHAR           //"Z+-"                                         , UTC_POS_CHAR                                         , UTC_NEG_CHAR                                         , chNull};static const int YMD_MIN_SIZE    = 10;   // CCYY-MM-DDstatic const int YMONTH_MIN_SIZE = 7;    // CCYY_MMstatic const int TIME_MIN_SIZE   = 8;    // hh:mm:ssstatic const int TIMEZONE_SIZE   = 5;    // hh:mmstatic const int DAY_SIZE        = 5;    // ---DD//static const int MONTH_SIZE      = 6;    // --MM--static const int MONTHDAY_SIZE   = 7;    // --MM-DDstatic const int NOT_FOUND       = -1;//define constants to be used in assigning default values for//all date/time excluding durationstatic const int YEAR_DEFAULT  = 2000;static const int MONTH_DEFAULT = 01;static const int DAY_DEFAULT   = 15;// order-relation on duration is a partial order. The dates below are used to// for comparison of 2 durations, based on the fact that// duration x and y is x<=y iff s+x<=s+y// see 3.2.6 duration W3C schema datatype specs//// the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone}static const int DATETIMES[][XMLDateTime::TOTAL_SIZE] ={    {1696, 9, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},	{1697, 2, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},	{1903, 3, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},	{1903, 7, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD}};// ---------------------------------------------------------------------------//  local methods// ---------------------------------------------------------------------------static inline int fQuotient(int a, int b){    div_t div_result = div(a, b);    return div_result.quot;}static inline int fQuotient(int temp, int low, int high){    return fQuotient(temp - low, high - low);}static inline int mod(int a, int b, int quotient){	return (a - quotient*b) ;}static inline int modulo (int temp, int low, int high){    //modulo(a - low, high - low) + low    int a = temp - low;    int b = high - low;    return (mod (a, b, fQuotient(a, b)) + low) ;}static inline bool isLeapYear(int year){    return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0)));}static int maxDayInMonthFor(int year, int month){    if ( month == 4 || month == 6 || month == 9 || month == 11 )    {        return 30;    }    else if ( month==2 )    {        if ( isLeapYear(year) )            return 29;        else            return 28;    }    else    {        return 31;    }}// ---------------------------------------------------------------------------//  static methods : for duration// ---------------------------------------------------------------------------/** * Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration") * * 3.2.6.2 Order relation on duration * *     In general, the order-relation on duration is a partial order since there is no *  determinate relationship between certain durations such as one month (P1M) and 30 days (P30D). *  The order-relation of two duration values x and y is x < y iff s+x < s+y for each qualified *  dateTime s in the list below. * *     These values for s cause the greatest deviations in the addition of dateTimes and durations * **/int XMLDateTime::compare(const XMLDateTime* const pDate1                       , const XMLDateTime* const pDate2                       , bool  strict){    //REVISIT: this is unoptimazed vs of comparing 2 durations    //         Algorithm is described in 3.2.6.2 W3C Schema Datatype specs    //    int resultA, resultB = INDETERMINATE;    //try and see if the objects are equal    if ( (resultA = compareOrder(pDate1, pDate2)) == EQUAL)        return EQUAL;    //long comparison algorithm is required    XMLDateTime tempA(XMLPlatformUtils::fgMemoryManager), *pTempA = &tempA;    XMLDateTime tempB(XMLPlatformUtils::fgMemoryManager), *pTempB = &tempB;    addDuration(pTempA, pDate1, 0);    addDuration(pTempB, pDate2, 0);    resultA = compareOrder(pTempA, pTempB);    if ( resultA == INDETERMINATE )        return INDETERMINATE;    addDuration(pTempA, pDate1, 1);    addDuration(pTempB, pDate2, 1);    resultB = compareOrder(pTempA, pTempB);    resultA = compareResult(resultA, resultB, strict);    if ( resultA == INDETERMINATE )        return INDETERMINATE;    addDuration(pTempA, pDate1, 2);    addDuration(pTempB, pDate2, 2);    resultB = compareOrder(pTempA, pTempB);    resultA = compareResult(resultA, resultB, strict);    if ( resultA == INDETERMINATE )        return INDETERMINATE;    addDuration(pTempA, pDate1, 3);    addDuration(pTempB, pDate2, 3);    resultB = compareOrder(pTempA, pTempB);    resultA = compareResult(resultA, resultB, strict);    return resultA;}//// Form a new XMLDateTime with duration and baseDate array// Note: C++        Java//       fNewDate   duration//       fDuration  date//void XMLDateTime::addDuration(XMLDateTime*             fNewDate                            , const XMLDateTime* const fDuration                            , int index){    //REVISIT: some code could be shared between normalize() and this method,    //         however is it worth moving it? The structures are different...    //    fNewDate->reset();    //add months (may be modified additionaly below)    int temp = DATETIMES[index][Month] + fDuration->fValue[Month];    fNewDate->fValue[Month] = modulo(temp, 1, 13);    int carry = fQuotient(temp, 1, 13);    //add years (may be modified additionaly below)    fNewDate->fValue[CentYear] = DATETIMES[index][CentYear] + fDuration->fValue[CentYear] + carry;    //add seconds    temp = DATETIMES[index][Second] + fDuration->fValue[Second];    carry = fQuotient (temp, 60);    fNewDate->fValue[Second] =  mod(temp, 60, carry);		    //add minutes    temp = DATETIMES[index][Minute] + fDuration->fValue[Minute] + carry;    carry = fQuotient(temp, 60);    fNewDate->fValue[Minute] = mod(temp, 60, carry);    //add hours    temp = DATETIMES[index][Hour] + fDuration->fValue[Hour] + carry;    carry = fQuotient(temp, 24);    fNewDate->fValue[Hour] = mod(temp, 24, carry);		    fNewDate->fValue[Day] = DATETIMES[index][Day] + fDuration->fValue[Day] + carry;    while ( true )    {        temp = maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]);        if ( fNewDate->fValue[Day] < 1 )        { //original fNewDate was negative            fNewDate->fValue[Day] += maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]-1);            carry = -1;        }        else if ( fNewDate->fValue[Day] > temp )        {            fNewDate->fValue[Day] -= temp;            carry = 1;        }        else        {            break;        }        temp = fNewDate->fValue[Month] + carry;        fNewDate->fValue[Month] = modulo(temp, 1, 13);        fNewDate->fValue[CentYear] += fQuotient(temp, 1, 13);    }    //fNewDate->fValue[utc] = UTC_STD_CHAR;    fNewDate->fValue[utc] = UTC_STD;}int XMLDateTime::compareResult(int resultA                             , int resultB                             , bool strict){    if ( resultB == INDETERMINATE )    {        return INDETERMINATE;    }    else if ( (resultA != resultB) &&              strict                )    {        return INDETERMINATE;    }    else if ( (resultA != resultB) &&              !strict               )    {        if ( (resultA != EQUAL) &&             (resultB != EQUAL)  )        {            return INDETERMINATE;        }        else        {            return (resultA != EQUAL)? resultA : resultB;        }    }    return resultA;	}// ---------------------------------------------------------------------------//  static methods : for others// ---------------------------------------------------------------------------int XMLDateTime::compare(const XMLDateTime* const pDate1                       , const XMLDateTime* const pDate2){    if (pDate1->fValue[utc] == pDate2->fValue[utc])    {        return XMLDateTime::compareOrder(pDate1, pDate2);    }    int c1, c2;    if ( pDate1->isNormalized())    {        c1 = compareResult(pDate1, pDate2, false, UTC_POS);        c2 = compareResult(pDate1, pDate2, false, UTC_NEG);        return getRetVal(c1, c2);    }    else if ( pDate2->isNormalized())    {        c1 = compareResult(pDate1, pDate2, true, UTC_POS);        c2 = compareResult(pDate1, pDate2, true, UTC_NEG);        return getRetVal(c1, c2);    }    return INDETERMINATE;	}int XMLDateTime::compareResult(const XMLDateTime* const pDate1                             , const XMLDateTime* const pDate2                             , bool  set2Left                             , int   utc_type){    XMLDateTime tmpDate = (set2Left ? *pDate1 : *pDate2);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲短视频| 美女在线视频一区| 久久99精品国产91久久来源| 国产精品69久久久久水密桃| 欧美乱妇一区二区三区不卡视频| 精品国产成人在线影院 | 一本到不卡精品视频在线观看 | 亚洲成人动漫一区| 国产盗摄一区二区三区| 欧美一卡二卡三卡四卡| 一区二区国产盗摄色噜噜| 国产精品一区二区久久精品爱涩| 欧美日本韩国一区二区三区视频 | 色综合久久中文综合久久97| 国产夜色精品一区二区av| 麻豆精品视频在线观看| 欧美日韩高清影院| 亚洲午夜久久久久久久久电影院| 丁香桃色午夜亚洲一区二区三区| 日韩一区二区麻豆国产| 日韩综合小视频| 欧美人牲a欧美精品| 一区二区三区四区亚洲| 91视频国产观看| 亚洲免费观看高清| 色偷偷一区二区三区| 中文字幕亚洲区| 成人黄页毛片网站| 国产精品你懂的| aaa亚洲精品一二三区| 国产精品私人自拍| 99re热视频精品| 亚洲欧美影音先锋| 色噜噜狠狠一区二区三区果冻| 亚洲色欲色欲www在线观看| 99精品国产热久久91蜜凸| 中文字幕亚洲不卡| 色婷婷av一区二区三区gif | 欧美视频完全免费看| 一区二区三区欧美| 欧美视频在线不卡| 蜜臀av一区二区在线免费观看| 日韩欧美一卡二卡| 国内外成人在线| 国产精品二三区| 在线观看日韩国产| 日韩av在线发布| 久久精品一区四区| 一本久久精品一区二区| 洋洋av久久久久久久一区| 欧美男女性生活在线直播观看| 日日噜噜夜夜狠狠视频欧美人 | 91国在线观看| 亚洲成a天堂v人片| 精品剧情在线观看| 成人一级视频在线观看| 亚洲一区二区在线观看视频| 在线电影院国产精品| 国产一区二区调教| 亚洲欧美一区二区不卡| 日韩色视频在线观看| 成人不卡免费av| 亚洲午夜电影网| 久久夜色精品国产噜噜av| 99久久婷婷国产综合精品电影 | 亚洲人成精品久久久久久| 欧美喷水一区二区| 成人网男人的天堂| 日韩av一区二区在线影视| 日本一区二区三区四区在线视频 | 欧美午夜精品理论片a级按摩| 日韩成人一区二区| 国产精品欧美一区二区三区| 欧美日韩国产色站一区二区三区| 国产美女在线精品| 亚洲一区二区三区精品在线| 欧美精品一区二区不卡| 欧美性高清videossexo| 成人午夜免费电影| 久久99久久精品欧美| 亚洲黄色小说网站| 国产欧美一区二区精品婷婷| 3d成人动漫网站| 一本色道久久综合精品竹菊| 国产剧情在线观看一区二区| 亚洲国产aⅴ天堂久久| 国产精品久久久一区麻豆最新章节| 制服丝袜中文字幕一区| 91浏览器在线视频| 国v精品久久久网| 九九精品一区二区| 视频一区二区三区中文字幕| 亚洲免费在线电影| 亚洲国产成人一区二区三区| 欧美一区二区三区在线看| 91一区二区三区在线观看| 国产精品一区二区三区网站| 九色综合国产一区二区三区| 亚洲精品国产视频| 国产精品久久国产精麻豆99网站 | 日韩伦理av电影| 国产视频一区二区在线观看| 日韩精品一区二区三区在线播放 | 天天av天天翘天天综合网色鬼国产 | 九九在线精品视频| 免费看精品久久片| 日韩精品欧美精品| 首页欧美精品中文字幕| 国产一区视频在线看| 欧美一级二级三级蜜桃| 成人精品免费网站| 国产综合色在线视频区| 日韩中文字幕区一区有砖一区| 一个色在线综合| 一区二区三区四区在线| 一级做a爱片久久| 亚洲一级二级三级| 亚洲一区二区三区精品在线| 亚洲大片在线观看| 亚洲成年人网站在线观看| 偷拍日韩校园综合在线| 青青草国产成人99久久| 黄网站免费久久| 国产成人av一区二区三区在线观看| 国产精品综合av一区二区国产馆| 国产一区二区不卡| 粉嫩一区二区三区在线看| 不卡视频一二三| 91成人免费网站| 91精品国产福利在线观看| 日韩一区二区免费在线电影| 精品99一区二区三区| 国产三级精品三级在线专区| 国产精品久久久99| 亚洲一卡二卡三卡四卡| 精品一区二区在线播放| 懂色av中文字幕一区二区三区| 成人免费毛片片v| 色噜噜夜夜夜综合网| 91麻豆精品国产91久久久| 久久噜噜亚洲综合| 亚洲精品国产精华液| 蜜桃久久久久久| av不卡在线播放| 91精品国产综合久久蜜臀| 久久久久久久久久久久电影| 椎名由奈av一区二区三区| 亚洲成人av一区二区| 国产成人免费视频网站高清观看视频| 成人黄色综合网站| 91精品国产综合久久久久久漫画| 精品国产91洋老外米糕| 亚洲欧美日韩中文字幕一区二区三区| 亚洲午夜精品在线| 国产一区不卡在线| 欧美亚洲日本一区| 久久久国产一区二区三区四区小说 | 精品一区二区三区的国产在线播放| 成人福利在线看| 91精品国产综合久久精品性色| 国产欧美一区二区三区沐欲| 亚洲国产日韩a在线播放| 国产精品一区在线观看你懂的| 欧美私人免费视频| 国产精品美女久久久久久久久久久 | 亚洲va欧美va人人爽| 国产精品69毛片高清亚洲| 欧美日韩第一区日日骚| 国产精品毛片a∨一区二区三区| 天堂成人国产精品一区| 99re视频精品| 国产日产欧美精品一区二区三区| 亚洲愉拍自拍另类高清精品| 国产经典欧美精品| 91麻豆精品国产91久久久久久久久 | 亚洲精品菠萝久久久久久久| 久久 天天综合| 7777精品久久久大香线蕉| 一区二区欧美国产| 国产成人在线视频免费播放| 欧美一区二区三区视频在线| 亚洲精品成人天堂一二三| 99精品在线免费| 国产精品天天看| 国产成人aaa| 久久蜜桃av一区二区天堂| 韩国在线一区二区| 精品久久久久久亚洲综合网| 视频精品一区二区| 欧美日韩一区在线观看| 亚洲人妖av一区二区| 成年人午夜久久久| 国产欧美精品一区二区色综合| 激情深爱一区二区| 亚洲精品一区二区三区福利| 伦理电影国产精品| 欧美成人a∨高清免费观看| 久久精品国产亚洲高清剧情介绍| 制服丝袜中文字幕亚洲| 亚洲动漫第一页|