Jump to content

Project i/o help


Vida Marcell
 Share

Recommended Posts

I want to be short, so i have a project manager, it can create and open projects. When creating it creates an xml file with properties like name, date, ect..

But i have problems with opening, whenever i launch it, i want it to read all the projects from a txt file where in every line a path leads to their xml file, and i load it into a listbox.

How do i detect that there are already text in a line? And if i want to delete a project from the manager (so also from the listbox) how do i know wich line should i delete?

Link to comment
Share on other sites

#include "UltraAppKit.h"

using namespace UltraAppKit;

int main(int argc, const char* argv[])
{
    String s = LoadFile("projects.txt");

    vector<String> sarr = s.Split("\n"); 

    for (auto s : sarr)
    {
        Print(s);
    }

    return 0;
}

And for deleting: Just rewrite the whole project text file, just iterate all your listbox items and save the data.

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...