クラス テンプレート toppers::c_pp_line< Container >

line指令を処理させるためのファンクタクラス [詳細]

#include "toppers/c_pp_line.hpp"

すべてのメンバ一覧

Public 型

typedef Container conatiner

Public メソッド

 c_pp_line (codeset_t codeset=ascii)
 コンストラクタ
void operator() (conatiner &cont, line_buf &buf)
 括弧演算子
const std::vector< line_buf > & pragmas () const
 pragma指令リストの取得


説明

template<class Container>
class toppers::c_pp_line< Container >

line指令を処理させるためのファンクタクラス

このクラスは basic_text クラスと組み合わせて使用します。

c_pp_line.hpp120 行で定義されています。


コンストラクタとデストラクタ

template<class Container>
toppers::c_pp_line< Container >::c_pp_line codeset_t  codeset = ascii  )  [inline, explicit]
 

コンストラクタ

引数:
codeset 文字コード指定

c_pp_line.hpp129 行で定義されています。

00130       : codeset_( codeset ), pragmas_( new std::vector<line_buf> )
00131     {
00132     }


関数

template<class Container>
void toppers::c_pp_line< Container >::operator() conatiner cont,
line_buf buf
[inline]
 

括弧演算子

引数:
cont line_buf を要素とするコンテナ
buf 1行バッファ

c_pp_line.hpp138 行で定義されています。

参照先 toppers::basic_line_buf< CharT, Traits, Allocator >::buf_toppers::text_line::file_toppers::text_line::line_toppers::basic_line_buf< CharT, Traits, Allocator >::line_.

00139     {
00140       using namespace boost::spirit;
00141       long line;
00142       std::string file;
00143       detail::c_pp_line_parser c_pp_line_p( line, file, codeset_ );
00144 
00145       if ( parse( buf.buf_.begin(), buf.buf_.end(), c_pp_line_p, space_p ).full ) // #line指令の処理
00146       {
00147         using namespace boost::filesystem;
00148         buf.line_.line_ = line;
00149         assert( file.size() >= 2 );
00150         try
00151         {
00152           std::string file_name( file.substr( 1, file.size()-2 ) );
00153           buf.line_.file_ = path( file_name, native );
00154         }
00155         catch ( ... )
00156         {
00157           // GNUのプリプロセッサはファイル名に相当する部分が<built-n>や<command line>
00158           // となる場合があるため、例外が発生する可能性あり
00159           buf.line_.file_ = path( "unknown", native );
00160         }
00161       }
00162       else
00163       {
00164         std::string param;
00165         detail::c_pp_pragma_parser c_pp_pragma_p( param );
00166 
00167         if ( parse( buf.buf_.begin(), buf.buf_.end(), c_pp_pragma_p, space_p ).full ) // #pragma指令の処理
00168         {
00169           line_buf t( buf );
00170           t.buf_ = param;
00171           pragmas_->push_back( t );
00172         }
00173         else
00174         {
00175           std::string::size_type pos = buf.buf_.find_first_not_of( " \t" );
00176           if ( pos == std::string::npos || buf.buf_[pos] != '#' )
00177           {
00178             cont.push_back( buf );
00179           }
00180           ++buf.line_.line_;
00181         }
00182       }
00183       buf.buf_.clear();
00184     }

template<class Container>
const std::vector<line_buf>& toppers::c_pp_line< Container >::pragmas  )  const [inline]
 

pragma指令リストの取得

戻り値:
pragma指令リストを返す

c_pp_line.hpp189 行で定義されています。

00189 { return *pragmas_; }


このクラスの説明は次のファイルから生成されました:
Copyright © 2006 by TAKAGI Nobuhisa.
このページは Wed Apr 12 16:32:02 2006 に Doxygen によって生成されました。