Lines Matching defs:fileName

92     std::string fileName = VALID_SNAPSHOT_PATH;
94 fileName += DEFAULT_SNAPSHOT_PREFIX;
104 fileName += timeStr;
107 fileName += (fileType == "png") ? VALID_SNAPSHOT_PNG_SUFFIX : VALID_SNAPSHOT_SUFFIX;
108 return fileName;
111 bool SnapShotUtils::CheckFileNameValid(const std::string& fileName, std::string fileType)
115 if (fileName.length() <= fileMinLength) {
116 std::cout << "error: fileName " << fileName.c_str() << " invalid, file length too short!" << std::endl;
120 std::string fileDir = fileName;
130 std::cout << "error: fileName " << fileName.c_str() << " invalid, realpath nullptr!" << std::endl;
134 std::cout << "error: fileName " << fileName.c_str() << " invalid, realpath "
140 const char *fileNameSuffix = fileName.c_str() + (fileName.length() - fileMinLength);
145 std::cout << "error: fileName " << fileName.c_str() << " invalid, suffix must be " << fileSuffix << std::endl;
270 bool SnapShotUtils::WriteToJpeg(const std::string& fileName, const WriteToJpegParam& param)
273 if (!CheckFileNameValid(fileName)) {
280 HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "snapshot:WriteToJpeg(%s)", fileName.c_str());
282 FILE *file = fopen(fileName.c_str(), "wb");
284 std::cout << "error: open file [" << fileName.c_str() << "] error, " << errno << "!" << std::endl;
361 bool SnapShotUtils::SaveSnapShot(const std::string& fileName, Media::PixelMap& pixelMap, std::string fileType)
375 imagePacker.StartPacking(fileName, option);
386 bool SnapShotUtils::WriteToJpegWithPixelMap(const std::string& fileName, Media::PixelMap& pixelMap)
389 return SaveSnapShot(fileName, pixelMap);
397 return SnapShotUtils::WriteToJpeg(fileName, param);
463 cmdArguments.fileName = optarg;
479 if (cmdArguments.fileName == "") {
480 cmdArguments.fileName = GenerateFileName(cmdArguments.fileType);
481 std::cout << "process: set filename to " << cmdArguments.fileName.c_str() << std::endl;
484 // check fileName
485 if (!SnapShotUtils::CheckFileNameValid(cmdArguments.fileName, cmdArguments.fileType)) {
486 std::cout << "error: filename " << cmdArguments.fileName.c_str() << " invalid!" << std::endl;