#include <FileUtilsTest.h>
◆ CREATE_FUNC()
◆ onEnter()
| void TestIsDirectoryExistAsync::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 TestCase .
在文件 FileUtilsTest.cpp 第 1092 行定义.
1095 auto s = Director::getInstance()->getWinSize();
1096 auto util = FileUtils::getInstance();
1097 int x = s.width/2, y = s.height/3;
1100 auto getMsg = [](
bool b,
const std::string& dir)-> std::string
1103 snprintf((
char *)msg, 512,
"%s for dir: \"%s\"", b ?
"success" :
"failed", dir.c_str());
1104 return std::string(msg);
1107 dir = util->getWritablePath();
1108 util->isDirectoryExist(dir, [=](
bool exists) {
1109 CCAssert(exists,
"Writable path should exist");
1110 auto label = Label::createWithSystemFont(getMsg(exists, dir),
"", 20);
1111 label->setPosition(x, y * 2);
1112 this->addChild(label);
virtual void onEnter() override
引用了 TestCase::onEnter().
◆ onExit()
| void TestIsDirectoryExistAsync::onExit |
( |
| ) |
|
|
overridevirtual |
在文件 FileUtilsTest.cpp 第 1116 行定义.
1119 FileUtils *sharedFileUtils = FileUtils::getInstance();
1122 sharedFileUtils->purgeCachedEntries();
1124 FileUtilsDemo::onExit();
◆ subtitle()
| std::string TestIsDirectoryExistAsync::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string TestIsDirectoryExistAsync::title |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp