2013-01-28 15:17:20 +08:00
|
|
|
#include "FileUtilsTest.h"
|
|
|
|
|
|
|
|
|
|
|
|
TESTLAYER_CREATE_FUNC(TestResolutionDirectories);
|
|
|
|
TESTLAYER_CREATE_FUNC(TestSearchPath);
|
|
|
|
TESTLAYER_CREATE_FUNC(TestFilenameLookup);
|
2013-02-01 22:18:43 +08:00
|
|
|
TESTLAYER_CREATE_FUNC(TestIsFileExist);
|
2013-04-28 00:36:37 +08:00
|
|
|
TESTLAYER_CREATE_FUNC(TextWritePlist);
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
static NEWTESTFUNC createFunctions[] = {
|
|
|
|
CF(TestResolutionDirectories),
|
|
|
|
CF(TestSearchPath),
|
2013-02-01 22:18:43 +08:00
|
|
|
CF(TestFilenameLookup),
|
2013-04-28 00:36:37 +08:00
|
|
|
CF(TestIsFileExist),
|
|
|
|
CF(TextWritePlist),
|
2013-01-28 15:17:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static int sceneIdx=-1;
|
|
|
|
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
static Layer* nextAction()
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
|
|
|
sceneIdx++;
|
|
|
|
sceneIdx = sceneIdx % MAX_LAYER;
|
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
Layer* layer = (createFunctions[sceneIdx])();
|
|
|
|
layer->init();
|
|
|
|
layer->autorelease();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
return layer;
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
static Layer* backAction()
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
|
|
|
sceneIdx--;
|
|
|
|
int total = MAX_LAYER;
|
|
|
|
if( sceneIdx < 0 )
|
|
|
|
sceneIdx += total;
|
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
Layer* layer = (createFunctions[sceneIdx])();
|
|
|
|
layer->init();
|
|
|
|
layer->autorelease();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
return layer;
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
static Layer* restartAction()
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Layer* layer = (createFunctions[sceneIdx])();
|
|
|
|
layer->init();
|
|
|
|
layer->autorelease();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
return layer;
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FileUtilsTestScene::runThisTest()
|
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Layer* layer = nextAction();
|
|
|
|
addChild(layer);
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
Director::getInstance()->replaceScene(this);
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// #pragma mark - FileUtilsDemo
|
|
|
|
|
|
|
|
void FileUtilsDemo::onEnter()
|
|
|
|
{
|
2013-06-07 08:12:28 +08:00
|
|
|
BaseTest::onEnter();
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void FileUtilsDemo::backCallback(Object* pSender)
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Scene* scene = new FileUtilsTestScene();
|
|
|
|
Layer* layer = backAction();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
scene->addChild(layer);
|
|
|
|
Director::getInstance()->replaceScene(scene);
|
|
|
|
scene->release();
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void FileUtilsDemo::nextCallback(Object* pSender)
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Scene* scene = new FileUtilsTestScene();
|
|
|
|
Layer* layer = nextAction();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
scene->addChild(layer);
|
|
|
|
Director::getInstance()->replaceScene(scene);
|
|
|
|
scene->release();
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void FileUtilsDemo::restartCallback(Object* pSender)
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Scene* scene = new FileUtilsTestScene();
|
|
|
|
Layer* layer = restartAction();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
scene->addChild(layer);
|
|
|
|
Director::getInstance()->replaceScene(scene);
|
|
|
|
scene->release();
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
string FileUtilsDemo::title()
|
|
|
|
{
|
|
|
|
return "No title";
|
|
|
|
}
|
|
|
|
|
|
|
|
string FileUtilsDemo::subtitle()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
//#pragma mark - TestResolutionDirectories
|
|
|
|
|
|
|
|
void TestResolutionDirectories::onEnter()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onEnter();
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
string ret;
|
|
|
|
|
|
|
|
sharedFileUtils->purgeCachedEntries();
|
2013-06-15 14:03:30 +08:00
|
|
|
_defaultSearchPathArray = sharedFileUtils->getSearchPaths();
|
|
|
|
vector<string> searchPaths = _defaultSearchPathArray;
|
2013-01-28 15:17:20 +08:00
|
|
|
searchPaths.insert(searchPaths.begin(), "Misc");
|
2013-01-29 09:56:38 +08:00
|
|
|
sharedFileUtils->setSearchPaths(searchPaths);
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
_defaultResolutionsOrderArray = sharedFileUtils->getSearchResolutionsOrder();
|
|
|
|
vector<string> resolutionsOrder = _defaultResolutionsOrderArray;
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin(), "resources-ipadhd");
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin()+1, "resources-ipad");
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin()+2, "resources-widehd");
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin()+3, "resources-wide");
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin()+4, "resources-hd");
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin()+5, "resources-iphone");
|
|
|
|
|
|
|
|
sharedFileUtils->setSearchResolutionsOrder(resolutionsOrder);
|
|
|
|
|
|
|
|
for( int i=1; i<7; i++) {
|
2013-06-20 14:17:10 +08:00
|
|
|
String *filename = String::createWithFormat("test%d.txt", i);
|
2013-01-28 15:17:20 +08:00
|
|
|
ret = sharedFileUtils->fullPathForFilename(filename->getCString());
|
2013-07-24 06:20:22 +08:00
|
|
|
log("%s -> %s", filename->getCString(), ret.c_str());
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestResolutionDirectories::onExit()
|
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
// reset search path
|
2013-06-15 14:03:30 +08:00
|
|
|
sharedFileUtils->setSearchPaths(_defaultSearchPathArray);
|
|
|
|
sharedFileUtils->setSearchResolutionsOrder(_defaultResolutionsOrderArray);
|
2013-01-28 15:17:20 +08:00
|
|
|
FileUtilsDemo::onExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestResolutionDirectories::title()
|
|
|
|
{
|
|
|
|
return "FileUtils: resolutions in directories";
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestResolutionDirectories::subtitle()
|
|
|
|
{
|
|
|
|
return "See the console";
|
|
|
|
}
|
|
|
|
|
|
|
|
//#pragma mark - TestSearchPath
|
|
|
|
|
|
|
|
void TestSearchPath::onEnter()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onEnter();
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
string ret;
|
|
|
|
|
|
|
|
sharedFileUtils->purgeCachedEntries();
|
2013-06-15 14:03:30 +08:00
|
|
|
_defaultSearchPathArray = sharedFileUtils->getSearchPaths();
|
|
|
|
vector<string> searchPaths = _defaultSearchPathArray;
|
2013-02-06 18:04:40 +08:00
|
|
|
string writablePath = sharedFileUtils->getWritablePath();
|
2013-01-28 17:43:53 +08:00
|
|
|
string fileName = writablePath+"external.txt";
|
|
|
|
char szBuf[100] = "Hello Cocos2d-x!";
|
|
|
|
FILE* fp = fopen(fileName.c_str(), "wb");
|
|
|
|
if (fp)
|
|
|
|
{
|
2013-06-01 08:06:11 +08:00
|
|
|
size_t ret = fwrite(szBuf, 1, strlen(szBuf), fp);
|
2013-07-20 13:01:27 +08:00
|
|
|
CCASSERT(ret == 0, "fwrite function returned nonzero value");
|
2013-01-28 17:43:53 +08:00
|
|
|
fclose(fp);
|
2013-06-01 08:06:11 +08:00
|
|
|
if (ret == 0)
|
2013-07-24 06:20:22 +08:00
|
|
|
log("Writing file to writable path succeed.");
|
2013-01-28 17:43:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
searchPaths.insert(searchPaths.begin(), writablePath);
|
|
|
|
searchPaths.insert(searchPaths.begin()+1, "Misc/searchpath1");
|
|
|
|
searchPaths.insert(searchPaths.begin()+2, "Misc/searchpath2");
|
2013-01-29 09:56:38 +08:00
|
|
|
sharedFileUtils->setSearchPaths(searchPaths);
|
2013-01-28 17:43:53 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
_defaultResolutionsOrderArray = sharedFileUtils->getSearchResolutionsOrder();
|
|
|
|
vector<string> resolutionsOrder = _defaultResolutionsOrderArray;
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
resolutionsOrder.insert(resolutionsOrder.begin(), "resources-ipad");
|
|
|
|
sharedFileUtils->setSearchResolutionsOrder(resolutionsOrder);
|
|
|
|
|
|
|
|
for( int i=1; i<3; i++) {
|
2013-06-20 14:17:10 +08:00
|
|
|
String *filename = String::createWithFormat("file%d.txt", i);
|
2013-01-28 15:17:20 +08:00
|
|
|
ret = sharedFileUtils->fullPathForFilename(filename->getCString());
|
2013-07-24 06:20:22 +08:00
|
|
|
log("%s -> %s", filename->getCString(), ret.c_str());
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
2013-01-28 17:43:53 +08:00
|
|
|
|
|
|
|
// Gets external.txt from writable path
|
|
|
|
string fullPath = sharedFileUtils->fullPathForFilename("external.txt");
|
2013-07-24 06:20:22 +08:00
|
|
|
log("external file path = %s", fullPath.c_str());
|
2013-03-03 10:32:09 +08:00
|
|
|
if (fullPath.length() > 0)
|
|
|
|
{
|
2013-01-28 17:43:53 +08:00
|
|
|
fp = fopen(fullPath.c_str(), "rb");
|
|
|
|
if (fp)
|
|
|
|
{
|
|
|
|
char szReadBuf[100] = {0};
|
2013-03-03 10:32:09 +08:00
|
|
|
int read = fread(szReadBuf, 1, strlen(szBuf), fp);
|
|
|
|
if (read > 0)
|
2013-07-24 06:20:22 +08:00
|
|
|
log("The content of file from writable path: %s", szReadBuf);
|
2013-01-28 17:43:53 +08:00
|
|
|
fclose(fp);
|
|
|
|
}
|
|
|
|
}
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestSearchPath::onExit()
|
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
// reset search path
|
2013-06-15 14:03:30 +08:00
|
|
|
sharedFileUtils->setSearchPaths(_defaultSearchPathArray);
|
|
|
|
sharedFileUtils->setSearchResolutionsOrder(_defaultResolutionsOrderArray);
|
2013-01-28 15:17:20 +08:00
|
|
|
FileUtilsDemo::onExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestSearchPath::title()
|
|
|
|
{
|
|
|
|
return "FileUtils: search path";
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestSearchPath::subtitle()
|
|
|
|
{
|
|
|
|
return "See the console";
|
|
|
|
}
|
|
|
|
|
|
|
|
//#pragma mark - TestFilenameLookup
|
|
|
|
|
|
|
|
void TestFilenameLookup::onEnter()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onEnter();
|
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Dictionary *dict = Dictionary::create();
|
|
|
|
dict->setObject(String::create("Images/grossini.png"), "grossini.bmp");
|
|
|
|
dict->setObject(String::create("Images/grossini.png"), "grossini.xcf");
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
sharedFileUtils->setFilenameLookupDictionary(dict);
|
|
|
|
|
|
|
|
|
|
|
|
// Instead of loading carlitos.xcf, it will load grossini.png
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite *sprite = Sprite::create("grossini.xcf");
|
2013-01-28 15:17:20 +08:00
|
|
|
this->addChild(sprite);
|
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
Size s = Director::getInstance()->getWinSize();
|
2013-07-12 14:11:55 +08:00
|
|
|
sprite->setPosition(Point(s.width/2, s.height/2));
|
2013-01-28 15:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestFilenameLookup::onExit()
|
|
|
|
{
|
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
// reset filename lookup
|
2013-06-20 14:17:10 +08:00
|
|
|
sharedFileUtils->setFilenameLookupDictionary(Dictionary::create());
|
2013-01-28 15:17:20 +08:00
|
|
|
|
|
|
|
FileUtilsDemo::onExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestFilenameLookup::title()
|
|
|
|
{
|
|
|
|
return "FileUtils: filename lookup";
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestFilenameLookup::subtitle()
|
|
|
|
{
|
|
|
|
return "See the console";
|
|
|
|
}
|
|
|
|
|
2013-02-01 22:18:43 +08:00
|
|
|
//#pragma mark - TestIsFileExist
|
|
|
|
|
|
|
|
void TestIsFileExist::onEnter()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onEnter();
|
2013-07-12 06:24:23 +08:00
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-02-01 22:18:43 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelTTF* pTTF = NULL;
|
2013-02-01 22:18:43 +08:00
|
|
|
bool isExist = false;
|
|
|
|
|
|
|
|
isExist = sharedFileUtils->isFileExist("Images/grossini.png");
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
pTTF = LabelTTF::create(isExist ? "Images/grossini.png exists" : "Images/grossini.png doesn't exist", "", 20);
|
2013-07-12 14:11:55 +08:00
|
|
|
pTTF->setPosition(Point(s.width/2, s.height/3));
|
2013-02-01 22:18:43 +08:00
|
|
|
this->addChild(pTTF);
|
|
|
|
|
|
|
|
isExist = sharedFileUtils->isFileExist("Images/grossini.xcf");
|
2013-06-20 14:17:10 +08:00
|
|
|
pTTF = LabelTTF::create(isExist ? "Images/grossini.xcf exists" : "Images/grossini.xcf doesn't exist", "", 20);
|
2013-07-12 14:11:55 +08:00
|
|
|
pTTF->setPosition(Point(s.width/2, s.height/3*2));
|
2013-02-01 22:18:43 +08:00
|
|
|
this->addChild(pTTF);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestIsFileExist::onExit()
|
|
|
|
{
|
|
|
|
|
2013-07-12 06:24:23 +08:00
|
|
|
FileUtils *sharedFileUtils = FileUtils::getInstance();
|
2013-02-01 22:18:43 +08:00
|
|
|
|
|
|
|
// reset filename lookup
|
2013-06-20 14:17:10 +08:00
|
|
|
sharedFileUtils->setFilenameLookupDictionary(Dictionary::create());
|
2013-02-01 22:18:43 +08:00
|
|
|
|
|
|
|
FileUtilsDemo::onExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestIsFileExist::title()
|
|
|
|
{
|
|
|
|
return "FileUtils: check whether the file exists";
|
|
|
|
}
|
|
|
|
|
|
|
|
string TestIsFileExist::subtitle()
|
|
|
|
{
|
|
|
|
return "";
|
2013-03-03 10:32:09 +08:00
|
|
|
}
|
2013-04-28 00:36:37 +08:00
|
|
|
|
2013-05-07 14:36:01 +08:00
|
|
|
//#pragma mark - TestWritePlist
|
2013-04-28 00:36:37 +08:00
|
|
|
|
|
|
|
void TextWritePlist::onEnter()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onEnter();
|
2013-06-20 14:17:10 +08:00
|
|
|
Dictionary *root = Dictionary::create();
|
|
|
|
String *string = String::create("string element value");
|
2013-04-28 00:36:37 +08:00
|
|
|
root->setObject(string, "string element key");
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Array *array = Array::create();
|
2013-04-28 00:36:37 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Dictionary *dictInArray = Dictionary::create();
|
|
|
|
dictInArray->setObject(String::create("string in dictInArray value 0"), "string in dictInArray key 0");
|
|
|
|
dictInArray->setObject(String::create("string in dictInArray value 1"), "string in dictInArray key 1");
|
2013-04-28 00:36:37 +08:00
|
|
|
array->addObject(dictInArray);
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
array->addObject(String::create("string in array"));
|
2013-04-28 00:36:37 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Array *arrayInArray = Array::create();
|
|
|
|
arrayInArray->addObject(String::create("string 0 in arrayInArray"));
|
|
|
|
arrayInArray->addObject(String::create("string 1 in arrayInArray"));
|
2013-04-28 00:36:37 +08:00
|
|
|
array->addObject(arrayInArray);
|
|
|
|
|
|
|
|
root->setObject(array, "array");
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Dictionary *dictInDict = Dictionary::create();
|
|
|
|
dictInDict->setObject(String::create("string in dictInDict value"), "string in dictInDict key");
|
2013-04-28 00:36:37 +08:00
|
|
|
|
|
|
|
root->setObject(dictInDict, "dictInDict");
|
|
|
|
|
|
|
|
// end with /
|
2013-07-12 06:24:23 +08:00
|
|
|
std::string writablePath = FileUtils::getInstance()->getWritablePath();
|
2013-04-28 00:36:37 +08:00
|
|
|
std::string fullPath = writablePath + "text.plist";
|
|
|
|
if(root->writeToFile(fullPath.c_str()))
|
2013-07-24 06:20:22 +08:00
|
|
|
log("see the plist file at %s", fullPath.c_str());
|
2013-04-28 00:36:37 +08:00
|
|
|
else
|
2013-07-24 06:20:22 +08:00
|
|
|
log("write plist file failed");
|
2013-04-28 00:36:37 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelTTF *label = LabelTTF::create(fullPath.c_str(), "Thonburi", 6);
|
2013-04-28 00:36:37 +08:00
|
|
|
this->addChild(label);
|
2013-07-12 06:24:23 +08:00
|
|
|
Size winSize = Director::getInstance()->getWinSize();
|
2013-07-12 14:11:55 +08:00
|
|
|
label->setPosition(Point(winSize.width/2, winSize.height/3));
|
2013-04-28 00:36:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextWritePlist::onExit()
|
|
|
|
{
|
|
|
|
FileUtilsDemo::onExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
string TextWritePlist::title()
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
return "FileUtils: Dictionary to plist";
|
2013-04-28 00:36:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
string TextWritePlist::subtitle()
|
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
std::string writablePath = FileUtils::getInstance()->getWritablePath().c_str();
|
2013-04-28 00:36:37 +08:00
|
|
|
return ("See plist file at your writablePath");
|
|
|
|
}
|