|
|
text_line.hpp説明を見る。00001 /* 00002 * TOPPERS/FDMP Kernel 00003 * Toyohashi Open Platform for Embedded Real-Time Systems/ 00004 * Function Distributed Multiprocessor Kernel 00005 * 00006 * Copyright (C) 2005 by Takagi Nobuhisa 00007 * 00008 * 上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation 00009 * によって公表されている GNU General Public License の Version 2 に記 00010 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア 00011 * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下, 00012 * 利用と呼ぶ)することを無償で許諾する. 00013 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 00014 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー 00015 * スコード中に含まれていること. 00016 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 00017 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 00018 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 00019 * の無保証規定を掲載すること. 00020 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 00021 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ 00022 * と. 00023 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 00024 * 作権表示,この利用条件および下記の無保証規定を掲載すること. 00025 * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに 00026 * 報告すること. 00027 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 00028 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. 00029 * 00030 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 00031 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も 00032 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直 00033 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない. 00034 * 00035 */ 00036 00047 #ifndef TOPPERS_TEXTLINE_HPP_ 00048 #define TOPPERS_TEXTLINE_HPP_ 00049 00050 #include "toppers/config.hpp" 00051 #include <iosfwd> 00052 #include <string> 00053 #include <boost/filesystem/path.hpp> 00054 00055 namespace toppers 00056 { 00057 00062 struct text_line 00063 { 00064 boost::filesystem::path file_; 00065 long line_; 00066 00070 text_line() 00071 : line_( 0 ) 00072 { 00073 } 00079 explicit text_line( const boost::filesystem::path& file, long line = 0 ) 00080 : file_( file ), line_( line ) 00081 { 00082 } 00088 explicit text_line( const std::string& file, long line = 0 ) 00089 : file_( file, boost::filesystem::native ), line_( line ) 00090 { 00091 } 00097 explicit text_line( const char* file, long line = 0 ) 00098 : file_( file, boost::filesystem::native ), line_( line ) 00099 { 00100 } 00105 void swap( text_line& other ) throw() 00106 { 00107 long t( line_ ); 00108 line_ = other.line_; 00109 other.line_ = t; 00110 const_cast<std::string&>( file_.string() ).swap( const_cast<std::string&>( other.file_.string() ) ); 00111 } 00112 }; 00113 00118 template 00119 < 00120 typename CharT, 00121 class Traits = std::char_traits<CharT>, 00122 class Allocator = std::allocator<CharT> 00123 > 00124 struct basic_line_buf 00125 { 00126 typedef std::basic_string<CharT, Traits, Allocator> string_type; 00127 00128 string_type buf_; 00129 text_line line_; 00130 00134 basic_line_buf() 00135 { 00136 } 00141 basic_line_buf( const text_line& line ) 00142 : line_( line ) 00143 { 00144 } 00150 basic_line_buf( const text_line& line, const string_type& data ) 00151 : buf_( data ), line_( line ) 00152 { 00153 } 00154 }; 00155 00156 typedef basic_line_buf<char> line_buf; 00157 00166 template <class Iterator> 00167 inline const text_line& get_text_line( Iterator iter ) 00168 { 00169 static text_line dummy; 00170 return dummy; 00171 } 00172 00173 } 00174 00175 #endif // ! TOPPERS_TEXTLINE_HPP_ Copyright © 2006 by TAKAGI Nobuhisa. このページは Wed Apr 12 16:31:57 2006 に Doxygen によって生成されました。 |