Lines Matching defs:file
4 * you may not use this file except in compliance with the License.
2633 SLOGI("check file not exist and try create %{public}s", filePath.c_str());
2642 SLOGD("file load in for path: %{public}s", filePath.c_str());
2644 ifstream file(filePath.c_str());
2645 if (!file.is_open()) {
2646 SLOGD("file not open! try open first ! ");
2647 file.open(filePath.c_str(), ios::out | ios::app);
2648 if (!file.is_open()) {
2649 SLOGE("open file again fail !");
2653 file.seekg(0, ios::end);
2654 const long fileLength = file.tellg();
2655 SLOGD("get file length(%{public}ld)!", fileLength);
2657 SLOGE("invalid file length(%{public}ld)!", fileLength);
2661 SLOGD("file new create empty ! try set init json ");
2665 SLOGE("open file in create new failed!");
2666 file.close();
2674 SLOGE("file empty init json fail !");
2675 file.close();
2682 file.seekg(0, ios::beg);
2683 copy(istreambuf_iterator<char>(file), istreambuf_iterator<char>(), back_inserter(content));
2684 file.close();
2690 SLOGI("file save in for path:%{public}s, content:%{public}s", filePath.c_str(), content.c_str());
2693 ofstream file;
2694 file.open(filePath.c_str(), ios::out | ios::trunc);
2695 if (!file.is_open()) {
2696 SLOGE("open file in save failed!");
2701 file.close();
2704 file.write(content.c_str(), content.length());
2705 if (file.fail()) {
2706 SLOGE("write content to file failed!");
2707 file.close();
2710 file.close();
2716 SLOGD("file check for path:%{public}s", filePath.c_str());
2720 SLOGD("file not open! try open first ! ");
2723 SLOGE("open file again fail !");
2737 SLOGE("open file in create new failed!");
2746 SLOGE("file empty init json fail! content %{public}s", content.c_str());