Lines Matching refs:input
93 int FileUtils::Read(std::ifstream& input, std::string& ret)
96 if (input.rdstate() != 0) {
97 PrintErrorNumberMsg("IO_ERROR", IO_ERROR, "invalid input stream");
102 while (input) {
103 input.read(&buffer[0], buffer.size());
104 ret.append(&buffer[0], input.gcount());
114 PrintErrorNumberMsg("IO_ERROR", IO_ERROR, "open input file: " + path + " failed");
137 int FileUtils::ReadInputByOffsetAndLength(std::ifstream& input, size_t offset, size_t length, std::string& ret)
143 input.seekg(offset);
144 if (ReadInputByLength(input, length, ret) < 0) {
151 int FileUtils::ReadInputByLength(std::ifstream& input, size_t length, std::string& ret)
157 if (input.rdstate() != 0) {
158 SIGNATURE_TOOLS_LOGE("Error input");
164 while (hasReadLen < length && input) {
166 input.read(&buffer[0], readLen);
167 bool flag = (input.gcount() != readLen);
173 hasReadLen += input.gcount();
182 bool FileUtils::AppendWriteFileByOffsetToFile(std::ifstream& input, std::ofstream& out, size_t offset, size_t size)
184 if (input.rdstate() != 0) {
185 SIGNATURE_TOOLS_LOGE("input failed.");
192 input.seekg(offset);
193 if (WriteInputToOutPut(input, out, size) < 0) {
202 std::ifstream input(inputFile, std::ios::binary);
204 bool flag = (0 != input.rdstate());
206 SIGNATURE_TOOLS_LOGE("Failed to get input stream object!");
215 while (!input.eof()) {
216 input.read(buffer, FILE_BUFFER_BLOCK);
218 if (input.fail() && !input.eof()) {
223 std::streamsize readLen = input.gcount();
248 int FileUtils::WriteInputToOutPut(std::ifstream& input, std::ofstream& output, size_t length)
286 readTask = readPool.Enqueue(readFunc, std::ref(input), length);
294 bool FileUtils::WriteInputToOutPut(const std::string& input, const std::string& output)
296 std::ifstream in(input, std::ios::binary);
300 SIGNATURE_TOOLS_LOGE("Failed to get input stream object!");