source: cfg_oil/trunk/toppers/text_line.hpp@ 8

Last change on this file since 8 was 8, checked in by msugi, 13 years ago

ディレクトリ構造の作成,ソース一式とReleaseビルドのコミット.

File size: 4.8 KB
Line 
1/*
2 * TOPPERS Software
3 * Toyohashi Open Platform for Embedded Real-Time Systems
4 *
5 * Copyright (C) 2005-2008 by TAKAGI Nobuhisa
6 *
7 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
8 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
9 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
10 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
11 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
12 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
13 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
14 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
15ƒƒ“ƒgi—˜—p
16 * ŽÒƒ}ƒjƒ…
17ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
18 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
19 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
20 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
21 * ‚ƁD
22 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
23ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
24ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
25 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
26 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
27 * •ñ‚·‚邱‚ƁD
28 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
29 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
30 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
31 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
32 * –Ɛӂ·‚邱‚ƁD
33 *
34 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
35 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
36 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
37 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
38 * ‚̐ӔC‚𕉂í‚È‚¢D
39 *
40 */
41
42/*!
43 * \file toppers/text_line.hpp
44 * \brief ƒeƒLƒXƒgƒf[ƒ^‚̍s‚ÉŠÖ‚·‚ééŒ¾’è‹`
45 *
46 * ‚±‚̃tƒ@ƒCƒ‹‚Å’è‹`‚³‚ê‚éƒNƒ‰ƒX
47 * \code
48 * struct text_line;
49 * struct basic_line_buf< CharT, Traits, Allocator >;
50 * \endcode
51 */
52#ifndef TOPPERS_TEXTLINE_HPP_
53#define TOPPERS_TEXTLINE_HPP_
54
55#include <iosfwd>
56#include <string>
57#include <algorithm>
58#include "toppers/config.hpp"
59
60namespace toppers
61{
62
63 /*!
64 * \struct text_line text_line.hpp "toppers/text_line.hpp"
65 * \brief ƒtƒ@ƒCƒ‹–¼‚ƍs”ԍ†‚Ì•ÛŽƒNƒ‰ƒX
66 */
67 struct text_line
68 {
69 std::string file; //!< ƒtƒ@ƒCƒ‹–¼
70 long line; //!< s”ԍ†i1`j
71
72 /*!
73 * \brief ƒfƒtƒHƒ‹ƒgƒRƒ“ƒXƒgƒ‰ƒNƒ^
74 */
75 text_line()
76 : line( 0 )
77 {
78 }
79 /*!
80 * \brief ƒRƒ“ƒXƒgƒ‰ƒNƒ^
81 * \param filename ƒtƒ@ƒCƒ‹–¼
82 * \param lineno s”ԍ†
83 */
84 explicit text_line( std::string const& filename, long lineno = 0 )
85 : file( filename ), line( lineno )
86 {
87 }
88 /*!
89 * \brief ƒRƒ“ƒXƒgƒ‰ƒNƒ^
90 * \param filename ƒtƒ@ƒCƒ‹–¼
91 * \param lineno s”ԍ†
92 */
93 explicit text_line( char const* filename, long lineno = 0 )
94 : file( filename ), line( lineno )
95 {
96 }
97 /*!
98 * \brief ƒIƒuƒWƒFƒNƒg‚ÌŒðŠ·
99 * \param other ŒðŠ·‘Ώۂ̃IƒuƒWƒFƒNƒg
100 */
101 void swap( text_line& other ) throw()
102 {
103 std::swap( line, other.line );
104 file.swap( other.file );
105 }
106 };
107
108 /*!
109 * \struct line_buf text_line.hpp "toppers/text_line.hpp"
110 * \brief 1 sƒeƒLƒXƒg‚ÌŠÇ—ƒNƒ‰ƒX
111 */
112 template
113 <
114 typename CharT,
115 class Traits = std::char_traits< CharT >,
116 class Allocator = std::allocator< CharT >
117 >
118 struct basic_line_buf
119 {
120 typedef std::basic_string< CharT, Traits, Allocator > string_type;
121
122 string_type buf; //!< sƒf[ƒ^‚ð•\‚·•¶Žš—ñ
123 text_line line; //!< s”ԍ†î•ñ
124
125 /*!
126 * \brief ƒfƒtƒHƒ‹ƒgƒRƒ“ƒXƒgƒ‰ƒNƒ^
127 */
128 basic_line_buf()
129 {
130 }
131 /*!
132 * \brief ƒRƒ“ƒXƒgƒ‰ƒNƒ^
133 * \param line s”ԍ†î•ñ
134 */
135 basic_line_buf( text_line const& line )
136 : line( line )
137 {
138 }
139 /*!
140 * \brief ƒRƒ“ƒXƒgƒ‰ƒNƒ^
141 * \param line s”ԍ†î•ñ
142 * \param data sƒf[ƒ^
143 */
144 basic_line_buf( text_line const& line, string_type const& data )
145 : buf( data ), line( line )
146 {
147 }
148 };
149
150 //! char ”Å‚Ì 1 sƒeƒLƒXƒgŠÇ—ƒNƒ‰ƒX
151 typedef basic_line_buf< char > line_buf;
152
153 /*!
154 * \brief ƒCƒeƒŒ[ƒ^‚ª•ÛŽ‚·‚és”ԍ†î•ñ‚̎擾
155 * \param iter ƒCƒeƒŒ[ƒ^
156 * \return s”ԍ†î•ñ‚Ö‚ÌŽQÆ‚ð•Ô‚·
157 *
158 * iter ‚ÅŽw’肵‚½ƒCƒeƒŒ[ƒ^‚ªs”ԍ†î•ñ‚ð•ÛŽ‚µ‚Ä‚¢‚é‚È‚çA‚»‚̍s”ԍ†î•ñ‚ð•Ô‚µ‚Ü‚·B
159 * s”ԍ†î•ñ‚ð•ÛŽ‚µ‚Ä‚¢‚È‚¢ê‡‚̓_ƒ~[ƒIƒuƒWƒFƒNƒg‚Ö‚ÌŽQÆ‚ð•Ô‚µ‚Ü‚·B
160 */
161 template < class Iterator >
162 inline text_line const& get_text_line( Iterator iter )
163 {
164 static text_line dummy;
165 return dummy;
166 }
167
168}
169
170#endif // ! TOPPERS_TEXTLINE_HPP_
Note: See TracBrowser for help on using the repository browser.