User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:get-output-stream-string [2019/11/11 05:00]
cl:functions:get-output-stream-string [2019/12/15 08:00] (current)
Line 1: Line 1:
 +====== Function GET-OUTPUT-STREAM-STRING ======
 +
 +====Syntax====
 +  * **get-output-stream-string** //​string-output-stream//​ → //string//
 +
 +====Arguments and Values====
 +  * //​string-output-stream//​ - a //​[[CL:​Glossary:​stream]]//​.
 +  * //string// - a //​[[CL:​Glossary:​string]]//​.
 +
 +====Description====
 +Returns a //​[[CL:​Glossary:​string]]//​ containing, in order, all the //​[[CL:​Glossary:​character|characters]]//​ that have been output to //​string-output-stream//​. This operation clears any //​[[CL:​Glossary:​character|characters]]//​ on //​string-output-stream//,​ so the //string// contains only those //​[[CL:​Glossary:​character|characters]]//​ which have been output since the last call to **[[CL:​Functions:​get-output-stream-string]]** or since the creation of the //​string-output-stream//,​ whichever occurred most recently.
 +
 +====Examples==== ​
 +<​blockquote> ​
 +([[CL:​Macros:​defparameter]] *a-stream* ([[CL:​Functions:​make-string-output-stream]])) <​r>​*A-STREAM*</​r>​
 +([[CL:​Macros:​defparameter]] *a-string* "​abcdefghijklm"​) <​r>​*A-STRING*</​r>​
 +*a-stream* <​r>"​abcdefghijklm"​ </r>
 +([[CL:​Functions:​write-string]] *a-string* *a-stream*) <​r>"​abcdefghijklm"​ </r>
 +(get-output-stream-string *a-stream*) <​r>"​abcdefghijklm"​ </r>
 +(get-output-stream-string *a-stream*) <​r>""</​r>​
 +</​blockquote>​
 +
 +====Side Effects====
 +The //​string-output-stream//​ is cleared.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +The consequences are undefined if //​stream-output-string//​ is //​[[CL:​Glossary:​closed]]//​.
 +
 +The consequences are undefined if //​string-output-stream//​ is a //​[[CL:​Glossary:​stream]]//​ that was not produced by **[[CL:​Functions:​make-string-output-stream]]**.
 +
 +The consequences are undefined if //​string-output-stream//​ was created implicitly by **[[CL:​Macros:​with-output-to-string]]** or **[[CL:​Functions:​format]]**.
 +
 +====See Also====
 +  * **[[CL:​Functions:​make-string-output-stream|Function MAKE-STRING-OUTPUT-STREAM]]**
 +
 +====Notes====
 +None.
 +
 +\issue{CLOSE-CONSTRUCTED-STREAM:​ARGUMENT-STREAM-ONLY} \issue{STRING-OUTPUT-STREAM-BASHING:​UNDEFINED}