26 lines
584 B
C++
26 lines
584 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <sstream>
|
|
|
|
#include "cmd/args/arg_base.hpp"
|
|
|
|
namespace fsh {
|
|
|
|
class ArgInput : public _Argument {
|
|
public:
|
|
static std::istream& get(std::shared_ptr<_Argument> a) {
|
|
return std::dynamic_pointer_cast<ArgInput>(a)->gvalue();
|
|
}
|
|
|
|
ArgInput() {}
|
|
|
|
virtual void svalue(const std::string& val, const Lexer::TokenType& type) override;
|
|
virtual std::istream& gvalue();
|
|
|
|
private:
|
|
std::optional<std::stringstream> str;
|
|
std::optional<std::ifstream> file;
|
|
};
|
|
|
|
} |