소스 검색

Improved File class

- renamed "create" method to "createNewFile" method
Patrick 4 년 전
부모
커밋
9c9d0f37eb
3개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      source/io/File.cpp
  2. 1 1
      source/io/File.hpp
  3. 2 2
      test/cases/io/FileTest.cpp

+ 1 - 1
source/io/File.cpp

@@ -50,7 +50,7 @@ bool ls_std::File::canExecute()
   return executable;
 }
 
-void ls_std::File::create()
+void ls_std::File::createNewFile()
 {
   if(!this->_exists(this->absoluteFilePath)) {
     std::ofstream file {this->absoluteFilePath};

+ 1 - 1
source/io/File.hpp

@@ -29,7 +29,7 @@ namespace ls_std {
       // additional functionality
 
       bool canExecute();
-      void create();
+      void createNewFile();
       bool exists();
       std::string getAbsoluteFilePath();
       std::string getName();

+ 2 - 2
test/cases/io/FileTest.cpp

@@ -71,12 +71,12 @@ namespace {
     ASSERT_FALSE(file.canExecute());
   }
 
-  TEST_F(FileTest, createAndRemove)
+  TEST_F(FileTest, createNewFileAndRemove)
   {
     ls_std::File file {TestHelper::getResourcesFolderLocation() + "tmp.txt"};
     ASSERT_FALSE(file.exists());
 
-    file.create();
+    file.createNewFile();
     ASSERT_TRUE(file.exists());
 
     file.remove();