Cocos2d-x userdefault saved XML file location in v3.3

Source: Internet
Author: User
Tags win32

Years is really a kill pig knife, flash I have not written a blog for two months, indeed recently did not spend time in development, ready to go to study for a few years, hehe, said really, do programmers really tired, sometimes overtime for income is not proportional to, haha, of course, I do not count to join this ranks, while young see outside the world.


Back to talk about today's theme, in fact, this is not what technical difficulties, is nothing to write something, suffer this period of time not spent in technology, so there is no writing, but happened recently want to write something to play, met this, so there is this article.


I am using the latest 3.3RC0 version of the development, just use the Userdefault class to store some simple small data, but because the program has some problems, so I need to open this saved Userdefault.xml file, in the previous version, are stored in the project \ Proj.win32\debug.win32 folder, so it is easy to find, but this time can not find, I later I see the blind, adjust the change of time to sort the way, no, directly search the XML file, or not, so only debugging to find this directory.


This class file is CCUserDefault.cpp, so the opening you can know how it is implemented, I mainly find how to save the file, which has such a function,

void Userdefault::initxmlfilepath ()
{
    if (! _isfilepathinitialized)
    {
        _filepath + = FileUtils:: GetInstance ()->getwritablepath () + xml_file_name;
        _isfilepathinitialized = true;
    }    
}

Because it is a cross-platform storage solution, so you know, we can print this read-write path to solve. Let's print a little bit.

Log ("%s", Fileutils::getinstance ()->getwritablepath (). C_STR ());


When I see this path, just want to say "hehe" ...


How to find this file in the back I think it will be, in the local directory, there will be its own project folder, open after the XML file will lie quietly there waiting for you. As for why Cocos to change the position, I think I should be able to understand it later. At this point, the problem solved, although only the key to a print statement, I This is nonsense wrote a bunch, haha ~ ~ ~


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.