#include <FileUtilsTest.h>
◆ CREATE_FUNC()
◆ onEnter()
| void TestIsFileExist::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 TestCase .
在文件 FileUtilsTest.cpp 第 249 行定义.
252 auto s = Director::getInstance()->getWinSize();
253 auto sharedFileUtils = FileUtils::getInstance();
255 Label* label =
nullptr;
256 bool isExist =
false;
258 isExist = sharedFileUtils->isFileExist(
"Images/grossini.png");
260 label = Label::createWithSystemFont(isExist ?
"Images/grossini.png exists" :
"Images/grossini.png doesn't exist",
"", 20);
261 label->setPosition(s.width/2, s.height/3);
262 this->addChild(label);
264 isExist = sharedFileUtils->isFileExist(
"Images/grossini.xcf");
265 label = Label::createWithSystemFont(isExist ?
"Images/grossini.xcf exists" :
"Images/grossini.xcf doesn't exist",
"", 20);
266 label->setPosition(s.width/2, s.height/3*2);
267 this->addChild(label);
virtual void onEnter() override
引用了 TestCase::onEnter().
◆ onExit()
| void TestIsFileExist::onExit |
( |
| ) |
|
|
overridevirtual |
在文件 FileUtilsTest.cpp 第 270 行定义.
273 FileUtils *sharedFileUtils = FileUtils::getInstance();
276 sharedFileUtils->setFilenameLookupDictionary(ValueMap());
278 FileUtilsDemo::onExit();
◆ subtitle()
| std::string TestIsFileExist::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string TestIsFileExist::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