@@ -563,7 +563,7 @@ void TextWritePlist::onEnter()
563
563
else
564
564
log (" write plist file failed" );
565
565
566
- auto label = Label::createWithTTF (fullPath. c_str () , " fonts/Thonburi.ttf" , 6 );
566
+ auto label = Label::createWithTTF (fullPath, " fonts/Thonburi.ttf" , 6 );
567
567
this ->addChild (label);
568
568
auto winSize = Director::getInstance ()->getWinSize ();
569
569
label->setPosition (winSize.width /2 , winSize.height /3 );
@@ -593,7 +593,7 @@ std::string TextWritePlist::title() const
593
593
594
594
std::string TextWritePlist::subtitle () const
595
595
{
596
- std::string writablePath = FileUtils::getInstance ()->getWritablePath (). c_str () ;
596
+ std::string writablePath = FileUtils::getInstance ()->getWritablePath ();
597
597
return (" See plist file at your writablePath" );
598
598
}
599
599
@@ -617,7 +617,7 @@ void TestWriteString::onEnter()
617
617
// writeTest
618
618
std::string writeDataStr = " the string data will be write into a file" ;
619
619
std::string fullPath = writablePath + fileName;
620
- if (FileUtils::getInstance ()->writeStringToFile (writeDataStr, fullPath. c_str () ))
620
+ if (FileUtils::getInstance ()->writeStringToFile (writeDataStr, fullPath))
621
621
{
622
622
log (" see the plist file at %s" , fullPath.c_str ());
623
623
writeResult->setString (" write success:" + writeDataStr);
@@ -793,7 +793,7 @@ void TestWriteData::onEnter()
793
793
Data writeData;
794
794
writeData.copy ((unsigned char *)writeDataStr.c_str (), writeDataStr.size ());
795
795
std::string fullPath = writablePath + fileName;
796
- if (FileUtils::getInstance ()->writeDataToFile (writeData, fullPath. c_str () ))
796
+ if (FileUtils::getInstance ()->writeDataToFile (writeData, fullPath))
797
797
{
798
798
log (" see the plist file at %s" , fullPath.c_str ());
799
799
writeResult->setString (" write success:" + writeDataStr);
@@ -881,7 +881,7 @@ void TestWriteValueMap::onEnter()
881
881
// end with /
882
882
std::string writablePath = FileUtils::getInstance ()->getWritablePath ();
883
883
std::string fullPath = writablePath + " testWriteValueMap.plist" ;
884
- if (FileUtils::getInstance ()->writeValueMapToFile (valueMap, fullPath. c_str () ))
884
+ if (FileUtils::getInstance ()->writeValueMapToFile (valueMap, fullPath))
885
885
{
886
886
log (" see the plist file at %s" , fullPath.c_str ());
887
887
writeResult->setString (" write success" );
@@ -892,7 +892,7 @@ void TestWriteValueMap::onEnter()
892
892
writeResult->setString (" write failed" );
893
893
}
894
894
895
- ValueMap readValueMap = FileUtils::getInstance ()->getValueMapFromFile (fullPath. c_str () );
895
+ ValueMap readValueMap = FileUtils::getInstance ()->getValueMapFromFile (fullPath);
896
896
std::string readDataStr = " read data:\n " ;
897
897
// read value map data
898
898
ValueMap readMapInMap = readValueMap[" data0" ].asValueMap ();
@@ -984,7 +984,7 @@ void TestWriteValueVector::onEnter()
984
984
// end with /
985
985
std::string writablePath = FileUtils::getInstance ()->getWritablePath ();
986
986
std::string fullPath = writablePath + " testWriteValueVector.plist" ;
987
- if (FileUtils::getInstance ()->writeValueVectorToFile (array, fullPath. c_str () ))
987
+ if (FileUtils::getInstance ()->writeValueVectorToFile (array, fullPath))
988
988
{
989
989
log (" see the plist file at %s" , fullPath.c_str ());
990
990
writeResult->setString (" write success" );
@@ -995,7 +995,7 @@ void TestWriteValueVector::onEnter()
995
995
writeResult->setString (" write failed" );
996
996
}
997
997
998
- ValueVector readArray = FileUtils::getInstance ()->getValueVectorFromFile (fullPath. c_str () );
998
+ ValueVector readArray = FileUtils::getInstance ()->getValueVectorFromFile (fullPath);
999
999
std::string readDataStr = " read data:\n " ;
1000
1000
// read value map data
1001
1001
ValueMap readMapInArray = readArray.at (0 ).asValueMap ();
0 commit comments