-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor doc: fix license agreement topic, contributors topic, datastrea…
…m::close_all()
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
doc/src/references/builtin/classes/!streams/datastream/close_all.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
Close a datastream as well as any that are connected to it. | ||
bool close_all(); | ||
## Returns: | ||
bool: true if the stream and any connected to it could be closed, false otherwise. | ||
## Remarks: | ||
This is exactly the same thing as calling the close method with the close_connected boolean argument set to true. On the default datastream class it will have no effect besides freeing the internal string, however you can look at the example below to see a case where there is an effect by calling close_all(). | ||
*/ | ||
|
||
// Example: | ||
void main() { | ||
datastream ds; | ||
hex_encoder h(ds); | ||
h.write("hi"); | ||
h.close_all(); // Will also close the datastream called ds because it is connected to the hex encoder. | ||
alert("example", ds.active); // Will display false, indicating that calling h.close_all() also caused ds.close() to implicitly be called. | ||
} |