Jump to content

Recommended Posts

Posted

Hi. When i'm add the fstream header to my project, i'm getting this error : 'EOF': undeclared identifier. It's happens only in leadwerk project. Why is it?

I'm trying to parse a custom file like this code:

entityDef weapon_shotgun 
{
    "weapon_name"               "weapon_shotgun"
    "def_projectile"            "projectile_bullet_shotgun"
    "ammoType"                  "ammo_shells"
    "ammoRequired"              "1"
    "clipSize"                  "8"
    "mtr_flashShader"           "muzzleflash"
}

so i can generate my entities from it.

Capture2.PNG

Capture.PNG

Posted

For some brilliant reason they made a #define for EOF and I had to undef it in the engine headers.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted
6 hours ago, reepblue said:

This is because EOF is conflicting with stream->EOF. What are you trying to do that the engine's stream class can't?

I'm trying to get it line by line with stop delimeter. I don't know if it exist in Stream class but simply i'm trying this..

ifstream myfile(filename);

if(myfile.is_open())
{
    string item;
    string name;
    string type;
    while(!myfile.eof())
    {
        getline(myfile,item,'|');
        
        getline(myfile,name,'|');
        while(getline(myfile,type,'|'))
        {
                cout<<type<<endl;
        }
        getline(myfile,type,'\n');
    }
    myfile.close();
}

Maybe i can do some extraction after stream->ReadLine()

Posted

Something like this will work (from memory):

auto s = LoadString("myfile.txt");
auto sarr = String::Split(s,"|");

 

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

×
×
  • Create New...