Lines Matching defs:Source
61 // Source is an awkward expression of a union type in C++: Stdin | File filename.
62 struct Source {
67 Source() : is_stdin_(false) {}
68 explicit Source(Type) : is_stdin_(true) {}
69 explicit Source(const std::string &name)
115 // SumFile hashes the contents of |source| with |md| and sets |*out_hex| to the
121 const Source &source) {
125 if (source.is_stdin()) {
128 if (!OpenFile(&fd, source.filename())) {
154 source.is_stdin() ? kStdinName : source.filename().c_str(),
184 // PrintFileSum hashes |source| with |md| and prints a line to stdout in the
187 static bool PrintFileSum(const EVP_MD *md, const Source &source) {
189 if (!SumFile(&hex_digest, md, source)) {
202 source.is_stdin() ? "-" : source.filename().c_str());
215 // Check reads lines from |source| where each line is in the format of the
223 const Source &source) {
227 if (source.is_stdin()) {
231 if (!OpenFile(&fd, source.filename())) {
285 source.is_stdin() ? kStdinName : source.filename().c_str(), line_no);
307 Source target_source;
310 target_source = Source(Source::STDIN);
312 target_source = Source(target_filename);
348 source.is_stdin() ? kStdinName : source.filename().c_str());
362 std::vector<Source> sources;
379 sources.push_back(Source(Source::STDIN));
432 sources.push_back(Source(*it));
436 sources.push_back(Source(Source::STDIN));
442 for (auto &source : sources) {
443 ok &= Check(check_args, md, source);
446 for (auto &source : sources) {
447 ok &= PrintFileSum(md, source);