Skip to content

Commit

Permalink
Merge pull request #312 from Trinitou/stream_documentation
Browse files Browse the repository at this point in the history
move stream documentation to stream.h
  • Loading branch information
abique authored Mar 11, 2023
2 parents 1797cf4 + ce4cac7 commit 279a2df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 0 additions & 10 deletions include/clap/ext/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
/// values and non-parameter state. This is used to persist a plugin's state
/// between project reloads, when duplicating and copying plugin instances, and
/// for host-side preset management.
///
/// ## Notes on using streams
///
/// When working with `clap_istream` and `clap_ostream` objects to load and save
/// state, it is important to keep in mind that the host may limit the number of
/// bytes that can be read or written at a time. The return values for the
/// stream read and write functions indicate how many bytes were actually read
/// or written. You need to use a loop to ensure that you read or write the
/// entirety of your state. Don't forget to also consider the negative return
/// values for the end of file and IO error codes.

static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap.state";

Expand Down
12 changes: 12 additions & 0 deletions include/clap/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
#include "private/std.h"
#include "private/macros.h"

/// @page Streams
///
/// ## Notes on using streams
///
/// When working with `clap_istream` and `clap_ostream` objects to load and save
/// state, it is important to keep in mind that the host may limit the number of
/// bytes that can be read or written at a time. The return values for the
/// stream read and write functions indicate how many bytes were actually read
/// or written. You need to use a loop to ensure that you read or write the
/// entirety of your state. Don't forget to also consider the negative return
/// values for the end of file and IO error codes.

#ifdef __cplusplus
extern "C" {
#endif
Expand Down

0 comments on commit 279a2df

Please sign in to comment.