Exemple #1
0
void SaveFiles(FILE *out, PROJECTITEM *proj, PROJECTITEM *children, int indent)
{
    while (children)
    {
        int i;
        for (i=0; i < indent; i++)
            fprintf(out, "\t");
        if (children->type == PJ_FOLDER)
        {
            fprintf(out, "<FOLDER TITLE=\"%s\">\n", children->displayName);
            SaveFiles(out, proj, children->children, indent + 1);
            for (i=0; i < indent; i++)
                fprintf(out, "\t");
            fprintf(out, "</FOLDER>\n");
        }
        else
        {
            fprintf(out, "<FILE NAME=\"%s\" TITLE=\"%s\" CLEAN=\"%d\"",relpath(children->realName, proj->realName), children->displayName, children->clean);
            if (HasProperties(children))
            {
                fprintf(out, ">\n");
                SaveProfiles(out, children, indent+1);
                for (i=0; i < indent; i++)
                    fprintf(out, "\t");
                fprintf(out, "</FILE>\n");
            }
            else
            {
                fprintf(out, "/>\n" );
            }
        }
        children = children->next;
    }
}
Exemple #2
0
//-------------------------------------------------------------------------
void SaveProject(PROJECTITEM *project)
{
    FILE *out ;
    char name[MAX_PATH];
    sprintf(name, "%s.cpj", project->realName);
    if (PropGetBool(NULL, "BACKUP_PROJECTS"))
        backup(name);	
    out = fopen(name, "w");
    if (!out)
    {
        ExtendedMessageBox("Save Error", 0, "Could not save project %s", project->displayName);
        return;
    }
    fprintf(out, "<CC386PROJECT>\n");
    fprintf(out, "\t<VERSION ID=\"%d\"/>\n", PROJVERS);
    fprintf(out, "\t<WORKAREA NAME=\"%s\"/>\n", workArea->realName);
    fprintf(out, "\t<TARGET TITLE=\"%s\">\n", project->displayName);
    SaveProfiles(out, project, 2);    
    fprintf(out, "\t\t<FILES>\n");
    SaveFiles(out, project, project->children,3);
    fprintf(out, "\t\t</FILES>\n");
    fprintf(out, "\t</TARGET>\n");
    fprintf(out, "</CC386PROJECT>\n");
    fclose(out);
    project->changed = FALSE;
}
void FLauncherProfileManager::SaveSettings( )
{
	SaveDeviceGroups();
	SaveSimpleProfiles();
	SaveProfiles();
}