MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / GetInputText

Method GetInputText

CodeFormat/src/FormatContext.cpp:216–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216std::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
230std::string FormatContext::GetInputPath() const {
231 return _inputPath;

Callers 3

CheckMethod · 0.80
ReformatMethod · 0.80
RangeReformatMethod · 0.80

Calls 4

ReadFileFunction · 0.85
rdbufMethod · 0.80
strMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected