| 214 | } |
| 215 | |
| 216 | std::string FormatContext::GetInputText() const { |
| 217 | if (_workMode == WorkMode::Stdin) { |
| 218 | std::stringstream buffer; |
| 219 | buffer << std::cin.rdbuf(); |
| 220 | return std::move(buffer.str()); |
| 221 | } else { |
| 222 | auto opText = ReadFile(_inputPath); |
| 223 | if (opText.has_value()) { |
| 224 | return std::move(opText.value()); |
| 225 | } |
| 226 | return ""; |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | std::string FormatContext::GetInputPath() const { |
| 231 | return _inputPath; |