mirror of
https://github.com/google/cdc-file-transfer.git
synced 2026-09-13 01:10:44 +03:00
Merge cdc_stream into asset_stream_manager (#26)
Adds start and stop commands to asset_stream_manager. asset_stream_manager will be renamed to cdc_stream next.
This commit is contained in:
@@ -31,6 +31,8 @@ class command;
|
||||
|
||||
namespace cdc_ft {
|
||||
|
||||
class BaseCommand;
|
||||
|
||||
// Class containing all configuration settings for asset streaming.
|
||||
// Reads flags from the command line and optionally applies overrides from
|
||||
// a json file.
|
||||
@@ -41,7 +43,7 @@ class AssetStreamConfig {
|
||||
~AssetStreamConfig();
|
||||
|
||||
// Registers arguments with Lyra.
|
||||
void RegisterCommandLineFlags(lyra::command& cmd);
|
||||
void RegisterCommandLineFlags(lyra::command& cmd, BaseCommand& base_command);
|
||||
|
||||
// Loads a configuration from the JSON file at |path| and overrides any config
|
||||
// values that are set in this file. Sample json file:
|
||||
@@ -88,16 +90,7 @@ class AssetStreamConfig {
|
||||
// Whether to log to a file or to stdout.
|
||||
bool log_to_stdout() const { return log_to_stdout_; }
|
||||
|
||||
// Workaround for Lyra not accepting errors from parsers.
|
||||
const std::string& jedec_parse_error() const { return jedec_parse_error_; }
|
||||
|
||||
private:
|
||||
// Jedec parser for Lyra options. Usage:
|
||||
// lyra::opt(JedecParser("size-flag", &size_bytes), "bytes"))
|
||||
// Sets jedec_parse_error_ on error, Lyra doesn't support errors from lambdas.
|
||||
std::function<void(const std::string&)> JedecParser(const char* flag_name,
|
||||
uint64_t* bytes);
|
||||
|
||||
SessionConfig session_cfg_;
|
||||
bool log_to_stdout_ = false;
|
||||
|
||||
@@ -111,9 +104,6 @@ class AssetStreamConfig {
|
||||
|
||||
// Maps flags to errors occurred while reading this flag.
|
||||
std::map<std::string, std::string> flag_read_errors_;
|
||||
|
||||
// Errors from parsing JEDEC sizes.
|
||||
std::string jedec_parse_error_;
|
||||
};
|
||||
|
||||
}; // namespace cdc_ft
|
||||
|
||||
Reference in New Issue
Block a user