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

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

?? astyle_main.cpp

?? Artistic Style 源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved.
 *
 * astyle_main.cpp
 * Copyright (c) 1998,1999,2000 Tal Davidson (davidsont@bigfoot.com). All rights reserved.
 *
 * This file is a part of "Artistic Style" - an indentater and reformatter
 * of C, C++, C# and Java source files.
 *
 * The "Artistic Style" project, including all files needed to compile it,
 * is free software; you can redistribute it and/or use it and/or modify it
 * under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2 of the License, 
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program.
 *
 */

#include "compiler_defines.h"
#include "astyle.h"

#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>


#define IS_OPTION(arg,op)          ((arg).compare(op)==0)
#define IS_OPTIONS(arg,a,b)        (IS_OPTION((arg),(a)) || IS_OPTION((arg),(b)))

#define IS_PARAM_OPTION(arg,op)    ((arg).COMPARE(0, strlen(op) , string(op))==0)
#define IS_PARAM_OPTIONS(arg,a,b)  (IS_PARAM_OPTION((arg),(a)) || IS_PARAM_OPTION((arg),(b)))

#define GET_PARAM(arg,op)          ((arg).substr(strlen(op)))
#define GET_PARAMS(arg,a,b)        (IS_PARAM_OPTION((arg),(a)) ? GET_PARAM((arg),(a)) : GET_PARAM((arg),(b)))


#ifdef USES_NAMESPACE
using namespace std;
using namespace astyle;
#endif

// default options:
ostream *_err = &cerr;
string _suffix = ".orig";
bool _modeManuallySet;

const string _version = "1.15.3";


class ASStreamIterator :
            public ASSourceIterator
{
    public:
        ASStreamIterator(istream *in);
        virtual ~ASStreamIterator();
        bool hasMoreLines() const;
        string nextLine();

    private:
        istream * inStream;
        char buffer[2048];
};

ASStreamIterator::ASStreamIterator(istream *in)
{
    inStream = in;
}

ASStreamIterator::~ASStreamIterator()
{
    delete inStream;
}


bool ASStreamIterator::hasMoreLines() const
{
    if (*inStream)
        return true;
    else
        return false;
}

/*
string ASStreamIterator::nextLine()
{
   char theInChar;
   char peekedChar;
   int  theBufferPosn = 0;
 
   //
   // treat '\n', '\r', '\n\r' and '\r\n' as an endline.
   //
   while (theBufferPosn < 2047 && inStream->get(theInChar))
   // while not eof
   {
      if (theInChar != '\n' && theInChar != '\r')
      {
	 buffer[theBufferPosn] = theInChar;
         theBufferPosn++;
      }
      else
      {
	peekedChar = inStream->peek();
	if (peekedChar != theInChar && (peekedChar == '\r' || peekedChar == '\n') )
         {
            inStream->get(theInChar);
         }
         break;
      }
   }
   buffer[theBufferPosn] = '\0';
 
   return string(buffer);
}
*/


string ASStreamIterator::nextLine()
{
    char *srcPtr;
    char *filterPtr;

    inStream->getline(buffer, 2047);
    srcPtr = filterPtr = buffer;

    while (*srcPtr != 0)
    {
        if (*srcPtr != '\r')
            *filterPtr++ = *srcPtr;
        srcPtr++;
    }
    *filterPtr = 0;

    return string(buffer);
}



void error(const char *why, const char* what)
{
    (*_err) << why << ' ' << what <<'\n';
    exit(1);
}



template<class ITER>
bool parseOptions(ASFormatter &formatter,
                  const ITER &optionsBegin,
                  const ITER &optionsEnd,
                  const string &errorInfo)
{
    ITER option;
    bool ok = true;
    string arg, subArg;

    for (option = optionsBegin; option != optionsEnd; ++option)
    {
        arg = *option; //string(*option);

        if (arg.COMPARE(0, 2, string("--")) == 0)
            ok &= parseOption(formatter, arg.substr(2), errorInfo);
        else if (arg[0] == '-')
        {
            int i;

            for (i=1; i < arg.length(); ++i)
            {
                if (isalpha(arg[i]) && i > 1)
                {
                    ok &= parseOption(formatter, subArg, errorInfo);
                    subArg = "";
                }
                subArg.append(1, arg[i]);
            }
            ok &= parseOption(formatter, subArg, errorInfo);
            subArg = "";
        }
        else
        {
            ok &= parseOption(formatter, arg, errorInfo);
            subArg = "";
        }
    }

    return ok;
}

void manuallySetJavaStyle(ASFormatter &formatter)
{
    formatter.setJavaStyle();
    _modeManuallySet = true;
}

void manuallySetCStyle(ASFormatter &formatter)
{
    formatter.setCStyle();
    _modeManuallySet = true;
}


bool parseOption(ASFormatter &formatter, const string &arg, const string &errorInfo)
{
    if ( IS_PARAM_OPTION(arg, "suffix=") )
    {
        string suffixParam = GET_PARAM(arg, "suffix=");
        if (suffixParam.length() > 0)
            _suffix = suffixParam;
    }
    else if ( IS_OPTION(arg ,"style=ansi") )
    {
        formatter.setBracketIndent(false);
        formatter.setSpaceIndentation(4);
        formatter.setBracketFormatMode(BREAK_MODE);
        formatter.setClassIndent(false);
        formatter.setSwitchIndent(false);
        formatter.setNamespaceIndent(false);
    }
    else if ( IS_OPTION(arg ,"style=gnu") )
    {
        formatter.setBlockIndent(true);
        formatter.setSpaceIndentation(2);
        formatter.setBracketFormatMode(BREAK_MODE);
        formatter.setClassIndent(false);
        formatter.setSwitchIndent(false);
        formatter.setNamespaceIndent(false);
    }
    else if ( IS_OPTION(arg ,"style=java") )
    {
        manuallySetJavaStyle(formatter);
        formatter.setBracketIndent(false);
        formatter.setSpaceIndentation(4);
        formatter.setBracketFormatMode(ATTACH_MODE);
        formatter.setSwitchIndent(false);
    }
    else if ( IS_OPTION(arg ,"style=kr") )
    {
        //manuallySetCStyle(formatter);
        formatter.setBracketIndent(false);
        formatter.setSpaceIndentation(4);
        formatter.setBracketFormatMode(ATTACH_MODE);
        formatter.setClassIndent(false);
        formatter.setSwitchIndent(false);
        formatter.setNamespaceIndent(false);
    }
    else if ( IS_OPTION(arg ,"style=linux") )
    {
        formatter.setBracketIndent(false);
        formatter.setSpaceIndentation(8);
        formatter.setBracketFormatMode(BDAC_MODE);
        formatter.setClassIndent(false);
        formatter.setSwitchIndent(false);
        formatter.setNamespaceIndent(false);
    }
    else if ( IS_OPTIONS(arg ,"c", "mode=c") )
    {
        manuallySetCStyle(formatter);
    }
    else if ( IS_OPTIONS(arg ,"j", "mode=java") )
    {
        manuallySetJavaStyle(formatter);
    }
    else if ( IS_OPTIONS(arg, "t", "indent=tab=") )
    {
        int spaceNum = 4;
        string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
        if (spaceNumParam.length() > 0)
            spaceNum = atoi(spaceNumParam.c_str());
        formatter.setTabIndentation(spaceNum, false);
    }
    else if ( IS_OPTIONS(arg, "T", "force-indent=tab=") )
    {
        int spaceNum = 4;
        string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
        if (spaceNumParam.length() > 0)
            spaceNum = atoi(spaceNumParam.c_str());
        formatter.setTabIndentation(spaceNum, true);
    }
    else if ( IS_PARAM_OPTION(arg, "indent=tab") )
    {
        formatter.setTabIndentation(4);
    }
    else if ( IS_PARAM_OPTIONS(arg, "s", "indent=spaces=") )
    {
        int spaceNum = 4;
        string spaceNumParam = GET_PARAMS(arg, "s", "indent=spaces=");
        if (spaceNumParam.length() > 0)
            spaceNum = atoi(spaceNumParam.c_str());
        formatter.setSpaceIndentation(spaceNum);
    }
    else if ( IS_PARAM_OPTION(arg, "indent=spaces") )
    {
        formatter.setSpaceIndentation(4);
    }
    else if ( IS_PARAM_OPTIONS(arg, "m", "min-conditional-indent=") )
    {
        int minIndent = 0;
        string minIndentParam = GET_PARAMS(arg, "m", "min-conditional-indent=");
        if (minIndentParam.length() > 0)
            minIndent = atoi(minIndentParam.c_str());
        formatter.setMinConditionalIndentLength(minIndent);
    }
    else if ( IS_PARAM_OPTIONS(arg, "M", "max-instatement-indent=") )
    {
        int maxIndent = 40;
        string maxIndentParam = GET_PARAMS(arg, "M", "max-instatement-indent=");
        if (maxIndentParam.length() > 0)
            maxIndent = atoi(maxIndentParam.c_str());
        formatter.setMaxInStatementIndentLength(maxIndent);
    }
    else if ( IS_OPTIONS(arg, "B", "indent-brackets") )
    {
        formatter.setBracketIndent(true);
    }
    else if ( IS_OPTIONS(arg, "G", "indent-blocks") )
    {
        formatter.setBlockIndent(true);
    }
    else if ( IS_OPTIONS(arg, "N", "indent-namespaces") )
    {
        formatter.setNamespaceIndent(true);
    }
    else if ( IS_OPTIONS(arg, "C", "indent-classes") )
    {
        formatter.setClassIndent(true);
    }
    else if ( IS_OPTIONS(arg, "S", "indent-switches") )
    {
        formatter.setSwitchIndent(true);
    }
    else if ( IS_OPTIONS(arg, "K", "indent-cases") )
    {
        formatter.setCaseIndent(true);
    }
    else if ( IS_OPTIONS(arg, "L", "indent-labels") )
    {
        formatter.setLabelIndent(true);
    }
    else if ( IS_OPTION(arg, "brackets=break-closing-headers") )
    {
        formatter.setBreakClosingHeaderBracketsMode(true);
    }
    else if ( IS_OPTIONS(arg, "b", "brackets=break") )
    {
        formatter.setBracketFormatMode(BREAK_MODE);
    }
    else if ( IS_OPTIONS(arg, "a", "brackets=attach") )
    {
        formatter.setBracketFormatMode(ATTACH_MODE);
    }
    else if ( IS_OPTIONS(arg, "l", "brackets=linux") )
    {
        formatter.setBracketFormatMode(BDAC_MODE);
    }
    else if ( IS_OPTIONS(arg, "O", "one-line=keep-blocks") )
    {
        formatter.setBreakOneLineBlocksMode(false);
    }
    else if ( IS_OPTIONS(arg, "o", "one-line=keep-statements") )
    {
        formatter.setSingleStatementsMode(false);
    }
    else if ( IS_OPTION(arg, "pad=paren") )
    {
        formatter.setParenthesisPaddingMode(true);
    }
    else if ( IS_OPTIONS(arg, "P", "pad=all") )
    {
        formatter.setOperatorPaddingMode(true);
        formatter.setParenthesisPaddingMode(true);
    }
    else if ( IS_OPTIONS(arg, "p", "pad=oper") )
    {
        formatter.setOperatorPaddingMode(true);
    }
    else if ( IS_OPTIONS(arg, "E", "fill-empty-lines") )
    {
        formatter.setEmptyLineFill(true);
    }
    else if (IS_OPTION(arg, "indent-preprocessor"))
    {
        formatter.setPreprocessorIndent(true);
    }
    else if (IS_OPTION(arg, "convert-tabs"))
    {
        formatter.setTabSpaceConversionMode(true);
    }
    else if (IS_OPTION(arg, "break-blocks=all"))
    {
        formatter.setBreakBlocksMode(true);
        formatter.setBreakClosingHeaderBlocksMode(true);
    }
    else if (IS_OPTION(arg, "break-blocks"))
    {
        formatter.setBreakBlocksMode(true);
    }
    else if (IS_OPTION(arg, "break-elseifs"))
    {
        formatter.setBreakElseIfsMode(true);
    }
    else if ( IS_OPTIONS(arg, "X", "errors-to-standard-output") )
    {
        _err = &cout;
    }
    else if ( IS_OPTIONS(arg ,"v", "version") )
    {
        (*_err) << "Artistic Style " << _version << endl;
        exit(1);
    }
    else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产剧情一区二区| 欧美日韩精品免费| 国产午夜精品一区二区三区四区| 免费人成在线不卡| 精品久久人人做人人爽| 国内精品视频666| 日本一区二区三区dvd视频在线| 精品系列免费在线观看| 欧美精彩视频一区二区三区| 成人丝袜视频网| 亚洲精品视频在线看| 欧美日韩不卡视频| 狠狠色伊人亚洲综合成人| 久久婷婷综合激情| 91美女片黄在线观看91美女| 欧美成人免费网站| 国产精品影视网| 欧洲av一区二区嗯嗯嗯啊| 亚洲成人av一区| xf在线a精品一区二区视频网站| 欧美日韩国产天堂| 韩国女主播成人在线观看| 亚洲国产精品v| 欧美日韩精品一区二区三区四区 | 精品国产精品一区二区夜夜嗨| 久久电影网站中文字幕| 国产精品美女久久久久高潮| 在线免费观看视频一区| 精品一区二区在线视频| 国产精品麻豆一区二区| 欧美日本一区二区在线观看| 国产风韵犹存在线视精品| 亚洲另类中文字| ww亚洲ww在线观看国产| 在线免费观看日本一区| 国产一区二区三区四区五区美女 | 久久99国内精品| 一区二区三区不卡视频在线观看| 欧美一区二区三区免费观看视频| 成人高清免费观看| 美腿丝袜在线亚洲一区| 日韩一区中文字幕| 久久综合九色综合欧美就去吻| 欧美综合天天夜夜久久| 国产高清视频一区| 蜜桃视频一区二区三区| 一区二区成人在线| 国产精品伦一区二区三级视频| 69久久99精品久久久久婷婷| 93久久精品日日躁夜夜躁欧美| 韩国一区二区视频| 午夜精品在线看| 一区二区三区毛片| 中文字幕在线不卡一区| 久久久久国色av免费看影院| 欧美精品乱码久久久久久按摩 | 亚洲日本在线a| 欧美极品aⅴ影院| 精品福利一区二区三区| 欧美日韩和欧美的一区二区| 91国产福利在线| www.一区二区| 性感美女极品91精品| 欧美欧美欧美欧美首页| 色综合天天综合在线视频| 国产精品一二三区在线| 美女一区二区视频| 午夜欧美大尺度福利影院在线看| 亚洲精选视频免费看| 中文字幕在线不卡一区二区三区 | 欧美一级二级在线观看| 欧美午夜视频网站| 在线这里只有精品| 色丁香久综合在线久综合在线观看| 成人av网站免费| 成人国产在线观看| 不卡一卡二卡三乱码免费网站| 国产精品77777| 国产精品亚洲一区二区三区妖精 | 欧美老年两性高潮| 在线电影国产精品| 91精品国产91久久久久久一区二区| 国产清纯白嫩初高生在线观看91 | 成人97人人超碰人人99| 欧美aaa在线| 九九精品一区二区| 国内精品国产三级国产a久久 | 亚洲v日本v欧美v久久精品| 一区二区三区四区亚洲| 亚洲一区二区免费视频| 天堂va蜜桃一区二区三区| 亚洲成av人片一区二区梦乃| 日韩精品亚洲一区二区三区免费| 视频在线观看一区| 久久99国内精品| 国产91高潮流白浆在线麻豆| 成人a级免费电影| 91久久一区二区| 欧美美女bb生活片| 精品国偷自产国产一区| 欧美国产日韩亚洲一区| 蜜桃久久久久久| 大陆成人av片| 国产黑丝在线一区二区三区| 国产成人精品三级| 91麻豆免费观看| 欧美肥胖老妇做爰| 久久精品免费在线观看| 亚洲天堂精品视频| 免费观看成人av| 成人一级片网址| 欧美日本一区二区在线观看| 精品国产成人系列| 亚洲免费在线观看| 久久成人羞羞网站| 99精品久久只有精品| 制服.丝袜.亚洲.另类.中文| 久久久av毛片精品| 亚洲国产你懂的| 国产一区二区91| 欧美日韩黄色一区二区| 中文字幕精品在线不卡| 天天色图综合网| 波多野结衣一区二区三区 | 一区二区在线免费| 国产丝袜在线精品| 久久 天天综合| 91免费看`日韩一区二区| 欧美色综合影院| 精品国产1区二区| 亚洲国产精品自拍| 成人自拍视频在线| 欧美一区二区三区在| 亚洲欧洲国产日韩| 精品一区二区三区在线播放| 欧美性猛交xxxxxxxx| 日本一区二区三级电影在线观看| 日韩电影在线看| 色88888久久久久久影院按摩| 久久久久久久综合日本| 天天亚洲美女在线视频| 色婷婷av一区二区三区之一色屋| 亚洲精品伦理在线| 国产iv一区二区三区| 91精品免费观看| 亚洲高清免费观看| av电影天堂一区二区在线观看| 精品精品国产高清a毛片牛牛| 亚洲午夜羞羞片| 色噜噜狠狠成人中文综合 | 日韩视频在线一区二区| 夜夜精品视频一区二区| av欧美精品.com| 777亚洲妇女| 亚洲成人动漫一区| jlzzjlzz亚洲日本少妇| wwwwww.欧美系列| 免费的国产精品| 91精品婷婷国产综合久久竹菊| 一卡二卡三卡日韩欧美| 97久久精品人人做人人爽50路| 久久精品人人做人人爽人人| 精品在线播放午夜| 欧美mv和日韩mv的网站| 秋霞电影一区二区| 日韩免费高清av| 久久不见久久见免费视频7| 日韩一级视频免费观看在线| 五月激情丁香一区二区三区| 欧美日韩情趣电影| 天使萌一区二区三区免费观看| 欧美影视一区在线| 天天色综合天天| 日韩欧美国产一区在线观看| 琪琪久久久久日韩精品| 日韩欧美国产一区二区三区| 久久99精品国产麻豆婷婷洗澡| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 99久久国产综合精品麻豆| 精品一区二区三区日韩| 亚洲人成精品久久久久| 国产麻豆视频一区二区| 555www色欧美视频| 青青国产91久久久久久| 日韩一区二区三区视频在线观看| 蜜桃久久精品一区二区| 久久久久久综合| 成人性生交大片免费看在线播放 | 国产欧美日韩激情| www.66久久| 亚洲国产精品综合小说图片区| 91麻豆精品国产91久久久久久| 蜜臀国产一区二区三区在线播放| 337p粉嫩大胆色噜噜噜噜亚洲 | 日本女优在线视频一区二区| 精品久久久久av影院| 成人午夜短视频| 亚洲午夜精品在线| 久久久亚洲精品一区二区三区| 成人福利视频网站|