Changeset e71b09a
- Timestamp:
- Jan 31, 2024, 12:14:17 PM (7 months ago)
- Branches:
- master
- Children:
- 32490deb
- Parents:
- 3da5885
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
r3da5885 re71b09a 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Sun Jan 28 13:28:23202414 %% Update Count : 597913 %% Last Modified On : Tue Jan 30 09:02:41 2024 14 %% Update Count : 6046 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 4148 4148 The goal of \CFA stream input/output (I/O) is to simplify the common cases\index{I/O!common case}, while fully supporting polymorphism and user defined types in a consistent way. 4149 4149 Stream I/O can be implicitly or explicitly formatted. 4150 Implicit formatting means \CFA selects the output or input format for values that matches the variable's type. 4151 Explicit formatting means additional information is specified to augment how an output or input of value is interpreted. 4150 Implicit formatting means \CFA selects an I/O format for values that matches a variable's type. 4151 Explicit formatting means additional I/O information is specified to control how a value is interpreted. 4152 4152 4153 \CFA formatting incorporates ideas from C ©printf©, \CC ©stream© manipulators, and Python implicit spacing and newline. 4153 4154 Specifically: … … 4157 4158 \CFA/\CC format manipulators are named, making them easier to read and remember. 4158 4159 \item 4159 ©printf©/Python separate sformat codes from associated variables, making it difficult to match codes with variables.4160 ©printf©/Python separate format codes from associated variables, making it difficult to match codes with variables. 4160 4161 \CFA/\CC co-locate codes with associated variables, where \CFA has the tighter binding. 4161 4162 \item 4162 Format manipulators in \CFA have local effect, whereas \CC have global effect, except ©setw©.4163 Hence, it is common programming practice to toggle manipulators on and then back to the default to prevent downstream side-effects.4163 Format manipulators in ©printf©/Python/\CFA have local effect, whereas \CC have global effect, except ©setw©. 4164 Hence, it is common \CC programming practice to toggle manipulators on and then back to the default to prevent downstream side-effects. 4164 4165 Without this programming style, errors occur when moving prints, as manipulator effects incorrectly flow into the new location. 4165 4166 Furthermore, to guarantee no side-effects, manipulator values must be saved and restored across function calls. 4167 \CC programers never do any of this. 4166 4168 \item 4167 4169 \CFA has more sophisticated implicit value spacing than Python, plus implicit newline at the end of a print. 4168 4170 \end{itemize} 4169 4171 4170 The standard polymorphic I/Os stream are ©stdin©/©sin© (input), ©stdout©/©sout© and ©stderr©/©serr© (output) (like C++ ©cin©/©cout©/©cerr©). 4171 Polymorphic streams ©exit© and ©abort© provide implicit program termination without and with generating a stack trace and core file. 4172 Stream ©exit© implicitly returns ©EXIT_FAILURE© to the shell. 4173 \begin{cfa} 4174 ®exit® | "x (" | x | ") negative value."; // terminate and return EXIT_FAILURE to shell 4175 ®abort® | "x (" | x | ") negative value."; // terminate and generate stack trace and core file 4176 \end{cfa} 4177 Note, \CFA stream variables ©stdin©, ©stdout©, ©stderr©, ©exit©, and ©abort© overload C variables ©stdin©, ©stdout©, ©stderr©, and functions ©exit© and ©abort©, respectively. 4172 4173 \subsection{Basic I/O} 4174 4175 The standard polymorphic I/O streams are ©stdin©/©sin© (input), ©stdout©/©sout©, and ©stderr©/©serr© (output) (like C++ ©cin©/©cout©/©cerr©). 4176 The standard I/O operator is the bit-wise (or) operator, ©'|'©, which is used to cascade multiple I/O operations. 4178 4177 The \CFA header file for the I/O library is \Indexc{fstream.hfa}. 4179 4180 4181 \subsection{Basic I/O}4182 4178 4183 4179 For implicit formatted output, the common case is printing a series of variables separated by whitespace. … … 4222 4218 1®, ®2®, ®3 4®, ®5®, ®6 4223 4219 \end{cfa} 4224 Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority \emph{overloadable} operator, other than assignment. 4220 The bit-wise ©|© operator is used for I/O, rather \CC shift-operators, ©<<© and ©>>©, as it is the lowest-priority \emph{overloadable} operator, other than assignment. 4221 (Operators ©||© and ©&&© are not overloadable in \CFA.) 4225 4222 Therefore, fewer output expressions require parenthesis. 4226 4223 \begin{cquote} … … 4245 4242 \end{cquote} 4246 4243 There is a weak similarity between the \CFA logical-or operator and the \Index{Shell pipe-operator} for moving data, where data flows in the correct direction for input but the opposite direction for output. 4247 Input and output use a uniform operator, ©|©, rather than \CC's ©<<© and ©>>© input/output operators , which preventsthis common error in \CC:4244 Input and output use a uniform operator, ©|©, rather than \CC's ©<<© and ©>>© input/output operators to prevent this common error in \CC: 4248 4245 \begin{C++} 4249 4246 cin << i; // why is this generating a lot of error messages? 4250 4247 \end{C++} 4248 4249 Streams ©exit© and ©abort© provide output with immediate program termination without and with generating a stack trace and core file. 4250 Stream ©exit© implicitly returns ©EXIT_FAILURE© to the shell. 4251 \begin{cfa} 4252 ®exit® | "x (" | x | ") negative value."; §\C{// print, terminate, and return EXIT\_FAILURE to shell}§ 4253 ®abort® | "x (" | x | ") negative value."; §\C{// print, terminate, and generate stack trace and core file}§ 4254 \end{cfa} 4255 Note, \CFA stream variables ©stdin©, ©stdout©, ©stderr©, ©exit©, and ©abort© overload C variables ©stdin©, ©stdout©, ©stderr©, and functions ©exit© and ©abort©, respectively. 4251 4256 4252 4257 For implicit formatted input, the common case is reading a sequence of values separated by whitespace, where the type of an input constant must match with the type of the input variable. … … 4291 4296 \end{tabular} 4292 4297 \end{cquote} 4293 4294 \VRef[Figure]{f:CFACommand-LineProcessing} shows idiomatic \CFA command-line processing and copying an input file to an output file. 4298 The format of numeric input values in the same as C constants without a trailing type suffix, as the input value-type is denoted by the input variable. 4299 For ©bool© type, the constants are ©true© and ©false©. 4300 For integral types, any number of digits, optionally preceded by a sign (©+© or ©-©), where a 4301 \begin{itemize} 4302 \item 4303 ©1©-©9© prefix introduces a decimal value (©0©-©9©), 4304 \item 4305 ©0© prefix introduces an octal value (©0©-©7©), and 4306 \item 4307 ©0x© or ©0X© prefix introduces a hexadecimal value (©0©-©f©) with lower or upper case letters. 4308 \end{itemize} 4309 For floating-point types, any number of decimal digits, optionally preceded by a sign (©+© or ©-©), optionally containing a decimal point, and optionally followed by an exponent, ©e© or ©E©, with signed (optional) decimal digits. 4310 Floating-point values can also be written in hexadecimal format preceded by ©0x© or ©0X© with hexadecimal digits and exponent denoted by ©p© or ©P©. 4311 In all cases, all whitespace characters are skipped until an appropriate value is found. 4312 \Textbf{If an appropriate value is not found, the exception ©missing_data© is raised.} 4313 4314 For the C-string type, there are two input forms: any number of \Textbf{non-whitespace} characters or a quoted sequence containing any characters except the closing quote, \ie there is no escape character supported in the string.. 4315 In both cases, the string is null terminated ©'\0'©. 4316 For the quoted string, the start and end quote characters can be any character and do not have to match \see{\ref{XXX}}. 4317 4318 \VRef[Figure]{f:IOStreamFunctions} shows the I/O stream operations for interacting with files other than ©cin©, ©cout©, and ©cerr©. 4319 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt] 4320 \item 4321 \Indexc{fail} tests the stream error-indicator, returning nonzero if it is set. 4322 \item 4323 \Indexc{clear} resets the stream error-indicator. 4324 \item 4325 \Indexc{flush} (©ofstream© only) causes any unwritten data for a stream to be written to the file. 4326 \item 4327 \Indexc{eof} (©ifstream© only) tests the end-of-file indicator for the stream pointed to by stream. 4328 Returns true if the end-of-file indicator is set, otherwise false. 4329 \item 4330 \Indexc{open} binds the file with ©name© to a stream accessed with ©mode© (see ©fopen©). 4331 \item 4332 \Indexc{close} flushes the stream and closes the file. 4333 \item 4334 \Indexc{write} (©ofstream© only) writes ©size© bytes to the stream. 4335 The bytes are written lazily when an internal buffer fills. 4336 Eager buffer writes are done with ©flush© 4337 \item 4338 \Indexc{read} (©ifstream© only) reads ©size© bytes from the stream. 4339 \item 4340 \Indexc{ungetc} (©ifstream© only) pushes the character back to the input stream. 4341 Pushed-back characters returned by subsequent reads in the reverse order of pushing. 4342 \end{itemize} 4343 The constructor functions: 4344 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt] 4345 \item 4346 create an unbound stream, which is subsequently bound to a file with ©open©. 4347 \item 4348 create a bound stream to the associated file with given ©mode©. 4349 \end{itemize} 4350 The destructor closes the stream. 4351 4352 \begin{figure} 4353 \begin{cfa} 4354 // *********************************** ofstream *********************************** 4355 bool fail( ofstream & );§\indexc{fail}\index{ofstream@©ofstream©!©fail©}§ 4356 void clear( ofstream & );§\indexc{clear}\index{ofstream@©ofstream©!©clear©}§ 4357 int flush( ofstream & );§\indexc{flush}\index{ofstream@©ofstream©!©flush©}§ 4358 void open( ofstream &, const char name[], const char mode[] = "w" );§\indexc{open}\index{ofstream@©ofstream©!©open©}§ 4359 void close( ofstream & );§\indexc{close}\index{ofstream@©ofstream©!©close©}§ 4360 ofstream & write( ofstream &, const char data[], size_t size );§\indexc{write}\index{ofstream@©ofstream©!©write©}§ 4361 void ?{}( ofstream & );§\index{ofstream@©ofstream©!©?{}©}§ 4362 void ?{}( ofstream &, const char name[], const char mode[] = "w" ); 4363 void ^?{}( ofstream & );§\index{ofstream@©ofstream©!©^?{}©}§ 4364 4365 // *********************************** ifstream *********************************** 4366 bool fail( ifstream & is );§\indexc{fail}\index{ifstream@©ifstream©!©fail©}§ 4367 void clear( ifstream & );§\indexc{clear}\index{ifstream@©ifstream©!©clear©}§ 4368 bool eof( ifstream & is );§\indexc{eof}\index{ifstream@©ifstream©!©eof©}§ 4369 void open( ifstream & is, const char name[], const char mode[] = "r" );§\indexc{open}\index{ifstream@©ifstream©!©open©}§ 4370 void close( ifstream & is );§\indexc{close}\index{ifstream@©ifstream©!©close©}§ 4371 ifstream & read( ifstream & is, char data[], size_t size );§\indexc{read}\index{ifstream@©ifstream©!©read©}§ 4372 ifstream & ungetc( ifstream & is, char c );§\indexc{unget}\index{ifstream@©ifstream©!©unget©}§ 4373 void ?{}( ifstream & is );§\index{ifstream@©ifstream©!©?{}©}§ 4374 void ?{}( ifstream & is, const char name[], const char mode[] = "r" ); 4375 void ^?{}( ifstream & is );§\index{ifstream@©ifstream©!©^?{}©}§ 4376 \end{cfa} 4377 \caption{I/O Stream Functions} 4378 \label{f:IOStreamFunctions} 4379 \end{figure} 4380 4381 \VRef[Figure]{f:CFACommand-LineProcessing} demonstrates the file operations by showing the idiomatic \CFA command-line processing and copying an input file to an output file. 4295 4382 Note, a stream variable may be copied because it is a reference to an underlying stream data-structures. 4296 All I/O errors are handles as exceptions, but end-of-file is not an exception as C programmers are use to explicitly checking for it.4383 \Textbf{All I/O errors are handled as exceptions}, but end-of-file is not an exception as C programmers are use to explicitly checking for it. 4297 4384 4298 4385 \begin{figure} … … 4335 4422 \end{figure} 4336 4423 4337 \VRef[Figure]{f:StreamFunctions} shows the stream operations.4338 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]4339 \item4340 \Indexc{fail} tests the stream error-indicator, returning nonzero if it is set.4341 \item4342 \Indexc{clear} resets the stream error-indicator.4343 \item4344 \Indexc{flush} (©ofstream© only) causes any unwritten data for a stream to be written to the file.4345 \item4346 \Indexc{eof} (©ifstream© only) tests the end-of-file indicator for the stream pointed to by stream.4347 Returns true if the end-of-file indicator is set, otherwise false.4348 \item4349 \Indexc{open} binds the file with ©name© to a stream accessed with ©mode© (see ©fopen©).4350 \item4351 \Indexc{close} flushes the stream and closes the file.4352 \item4353 \Indexc{write} (©ofstream© only) writes ©size© bytes to the stream.4354 The bytes are written lazily when an internal buffer fills.4355 Eager buffer writes are done with ©flush©4356 \item4357 \Indexc{read} (©ifstream© only) reads ©size© bytes from the stream.4358 \item4359 \Indexc{ungetc} (©ifstream© only) pushes the character back to the input stream.4360 Pushed-back characters returned by subsequent reads in the reverse order of pushing.4361 \end{itemize}4362 The constructor functions:4363 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]4364 \item4365 create an unbound stream, which is subsequently bound to a file with ©open©.4366 \item4367 create a bound stream to the associated file with given ©mode©.4368 \end{itemize}4369 The destructor closes the stream.4370 4371 \begin{figure}4372 \begin{cfa}4373 // *********************************** ofstream ***********************************4374 4375 bool fail( ofstream & );§\indexc{fail}\index{ofstream@©ofstream©!©fail©}§4376 void clear( ofstream & );§\indexc{clear}\index{ofstream@©ofstream©!©clear©}§4377 int flush( ofstream & );§\indexc{flush}\index{ofstream@©ofstream©!©flush©}§4378 void open( ofstream &, const char name[], const char mode[] = "w" );§\indexc{open}\index{ofstream@©ofstream©!©open©}§4379 void close( ofstream & );§\indexc{close}\index{ofstream@©ofstream©!©close©}§4380 ofstream & write( ofstream &, const char data[], size_t size );§\indexc{write}\index{ofstream@©ofstream©!©write©}§4381 4382 void ?{}( ofstream & );§\index{ofstream@©ofstream©!©?{}©}§4383 void ?{}( ofstream &, const char name[], const char mode[] = "w" );4384 void ^?{}( ofstream & );§\index{ofstream@©ofstream©!©^?{}©}§4385 4386 // *********************************** ifstream ***********************************4387 4388 bool fail( ifstream & is );§\indexc{fail}\index{ifstream@©ifstream©!©fail©}§4389 void clear( ifstream & );§\indexc{clear}\index{ifstream@©ifstream©!©clear©}§4390 bool eof( ifstream & is );§\indexc{eof}\index{ifstream@©ifstream©!©eof©}§4391 void open( ifstream & is, const char name[], const char mode[] = "r" );§\indexc{open}\index{ifstream@©ifstream©!©open©}§4392 void close( ifstream & is );§\indexc{close}\index{ifstream@©ifstream©!©close©}§4393 ifstream & read( ifstream & is, char data[], size_t size );§\indexc{read}\index{ifstream@©ifstream©!©read©}§4394 ifstream & ungetc( ifstream & is, char c );§\indexc{unget}\index{ifstream@©ifstream©!©unget©}§4395 4396 void ?{}( ifstream & is );§\index{ifstream@©ifstream©!©?{}©}§4397 void ?{}( ifstream & is, const char name[], const char mode[] = "r" );4398 void ^?{}( ifstream & is );§\index{ifstream@©ifstream©!©^?{}©}§4399 \end{cfa}4400 \caption{Stream Functions}4401 \label{f:StreamFunctions}4402 \end{figure}4403 4404 4424 4405 4425 \subsection{Implicit Separator} 4406 4426 4407 4427 The \Index{implicit separator}\index{I/O!separator} character (space/blank) is a separator not a terminator for output. 4408 The rules for implicitly adding theseparator are:4428 The rules for implicitly adding a separator are: 4409 4429 \begin{enumerate} 4410 4430 \item … … 4438 4458 \end{cfa} 4439 4459 \begin{cfa}[showspaces=true] 4440 1®,® x 2®.® x 3®;® x 4®!® x 5®?® x 6®%® x 7§\R{\LstStringStyle{\textcent}}§ x 8§\R{\LstStringStyle{\guillemotright}}§ x 9®)® x 10®]® x 11®}® x4460 Input1®,® x 2®.® x 3®;® x 4®!® x 5®?® x 6®%® x 7§\R{\LstStringStyle{\textcent}}§ x 8§\R{\LstStringStyle{\guillemotright}}§ x 9®)® x 10®]® x 11®}® x 4441 4461 \end{cfa} 4442 4462 … … 4653 4673 4654 4674 4655 \subsection{Output ValueManipulators}4675 \subsection{Output Manipulators} 4656 4676 4657 4677 The following \Index{manipulator}s control formatting (printing) of the argument output values. … … 4911 4931 4912 4932 4913 \subsection{Input Value Manipulators} 4914 4915 The format of numeric input values in the same as C constants without a trailing type suffix, as the input value-type is denoted by the input variable. 4916 For ©bool© type, the constants are ©true© and ©false©. 4917 For integral types, any number of digits, optionally preceded by a sign (©+© or ©-©), where a 4918 \begin{itemize} 4919 \item 4920 ©1©-©9© prefix introduces a decimal value (©0©-©9©), 4921 \item 4922 ©0© prefix introduces an octal value (©0©-©7©), and 4923 \item 4924 ©0x© or ©0X© prefix introduces a hexadecimal value (©0©-©f©) with lower or upper case letters. 4925 \end{itemize} 4926 For floating-point types, any number of decimal digits, optionally preceded by a sign (©+© or ©-©), optionally containing a decimal point, and optionally followed by an exponent, ©e© or ©E©, with signed (optional) decimal digits. 4927 Floating-point values can also be written in hexadecimal format preceded by ©0x© or ©0X© with hexadecimal digits and exponent denoted by ©p© or ©P©. 4928 4929 For the C-string type, the input values are \emph{not} the same as C-string constants, \ie double quotes bracketing arbitrary text with escape sequences. 4930 Instead, the next sequence of non-whitespace characters are read, and the input sequence is terminated with delimiter ©'\0'©. 4931 The string variable \emph{must} be large enough to contain the input sequence. 4933 \subsection{Input Manipulators} 4934 4935 The following \Index{manipulator}s control scanning of input values (reading), and only affect the format of the argument. 4936 4937 Certain manipulators support a \newterm{scanset}, which is a simple regular expression, where the matching set contains any Latin-1 character (8-bits) or character ranges using minus. 4938 For example, the scanset \lstinline{"a-zA-Z -/?§"} matches any number of characters between ©'a'© and ©'z'©, between ©'A'© and ©'Z'©, between space and ©'/'©, and characters ©'?'© and (Latin-1) ©'§'©. 4939 The following string is matched by this scanset: 4940 \begin{cfa} 4941 !&%$ abAA () ZZZ ?? xx§\S\S\S§ 4942 \end{cfa} 4943 To match a minus, put it as the first character, ©"-0-9"©. 4944 Other complex forms of regular-expression matching are not supported. 4945 4946 A string variable \emph{must} be large enough to contain the input sequence. 4932 4947 To force programmers to consider buffer overruns for C-string input, C-strings can only be read with a width field, which should specify a size less than or equal to the C-string size, \eg: 4933 4948 \begin{cfa} … … 4936 4951 \end{cfa} 4937 4952 4938 A scanset is a simple regular expression, where the matching set contains any Latin-1 character (8-bits) or character ranges using minus. 4939 For example, the scanset \lstinline{"a-zA-Z -/?§"} matches characters between ©'a'© and ©'z'©, between ©'A'© and ©'Z'©, between space and ©'/'©, and characters ©'?'© and (Latin-1) ©'§'©. 4940 The following string is matched by this scanset: 4941 \begin{cfa} 4942 !&%$ abAA () ZZZ ?? xx§\S\S\S§ 4943 \end{cfa} 4944 To match a minus, put it as the first character, ©"-0-9"©. 4945 Other complex forms of regular-expression matching are not supported. 4946 4947 The following \Index{manipulator}s control scanning of input values (reading), and only affect the format of the argument. 4953 Currently, there is no mechanism to detect if a value read exceeds the capwhen Most types are finite sized, \eg integral types only store value that fit into their corresponding storage, 8, 16, 32, 64, 128 bits. 4954 Hence, an input value may be too large, and the result of the read is often considered undefined, which leads to difficlt to locate runtime errors. 4955 All reads in \CFA check if values do not fit into the argument variable's type and raise the exception 4956 All types are 4957 4948 4958 \begin{enumerate} 4949 4959 \item 4950 \Indexc{skip}( pattern )\index{manipulator!skip@©skip©}, ©skip©( length)4951 The pattern is composed of white-space and non-white-space characters, where \emph{any} white-space character matches 0 or more input white-space characters (hence, consecutive white-space characters in the pattern are combined), and each non-white-space character matches exactly with an input character.4952 The length is composed of the next $N$ characters, including the newline character.4960 \Indexc{skip}( scanset )\index{manipulator!skip@©skip©}, ©skip©( $N$ ) 4961 The first form uses a scanset to skip matching characters. 4962 The second form skips the next $N$ characters, including newline. 4953 4963 If the match successes, the input characters are discarded, and input continues with the next character. 4954 4964 If the match fails, the input characters are left unread. … … 4964 4974 4965 4975 \item 4966 \Indexc{wdi}( maximum, reference )\index{manipulator!wdi@©wdi©} 4967 For all types except ©char *©, maximum is the maximum number of characters read for the current operation. 4976 \Indexc{wdi}( maximum, variable )\index{manipulator!wdi@©wdi©} 4977 For all types except ©char *©, whitespace is skipped until an appropriate value is found for the specified variable type. 4978 maximum is the maximum number of characters read for the current operation. 4968 4979 \begin{cfa}[belowskip=0pt] 4969 4980 char ch; char ca[3]; int i; double d; 4970 sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d ); // c == 'a', ca = "bcd", i == 123, d == 345.64981 sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d ); // c == 'a', ca == "bcd", i == 123, d == 345.6 4971 4982 \end{cfa} 4972 4983 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4977 4988 Note, input ©wdi© cannot be overloaded with output ©wd© because both have the same parameters but return different types. 4978 4989 Currently, \CFA cannot distinguish between these two manipulators in the middle of an ©sout©/©sin© expression based on return type. 4990 4991 \item 4992 \Indexc{wdi}( maximum size, ©char s[]© )\index{manipulator!wdi@©wdi©} 4993 For type ©char *©, maximum is the maximum number of characters read for the current operation. 4994 Any number of non-whitespace characters, stopping at the first whitespace character found. A terminating null character is automatically added at the end of the stored sequence 4995 \begin{cfa}[belowskip=0pt] 4996 char cstr[10]; 4997 sin | wdi( sizeof(cstr), cstr ); 4998 \end{cfa} 4999 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] 5000 ®abcd1233.456E+2® 5001 \end{cfa} 5002 5003 \item 5004 \Indexc{wdi}( maximum size, maximum read, ©char s[]© )\index{manipulator!wdi@©wdi©} 5005 For type ©char *©, maximum is the maximum number of characters read for the current operation. 5006 \begin{cfa}[belowskip=0pt] 5007 char ch; char ca[3]; int i; double d; 5008 sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d ); // c == 'a', ca == "bcd", i == 123, d == 345.6 5009 \end{cfa} 5010 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] 5011 ®abcd1233.456E+2® 5012 \end{cfa} 4979 5013 4980 5014 \item … … 5013 5047 \end{cfa} 5014 5048 5049 \Indexc{quoted}( char delimit, wdi-input-string )\index{manipulator!quoted@©quoted©} 5050 Is an ©excl© with scanset ©"delimit"©, which consumes all characters up to the delimit character. 5051 If the delimit character is omitted, it defaults to ©'\n'© (newline). 5052 5015 5053 \item 5016 5054 \Indexc{getline}( char delimit, wdi-input-string )\index{manipulator!getline@©getline©} 5017 Is an @excl@with scanset ©"delimit"©, which consumes all characters up to the delimit character.5055 Is an ©excl© with scanset ©"delimit"©, which consumes all characters up to the delimit character. 5018 5056 If the delimit character is omitted, it defaults to ©'\n'© (newline). 5019 5057 \end{enumerate}
Note: See TracChangeset
for help on using the changeset viewer.