ErhanK Posted January 27, 2020 Share Posted January 27, 2020 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. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted January 27, 2020 Share Posted January 27, 2020 Try including <iostream.h> in your project. I think thats the right header... I'm not sure... Leadwerks also has an inbuilt filesystem, have you tried using that? 1 Quote Link to comment Share on other sites More sharing options...
reepblue Posted January 28, 2020 Share Posted January 28, 2020 This is because EOF is conflicting with stream->EOF. What are you trying to do that the engine's stream class can't? 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted January 28, 2020 Share Posted January 28, 2020 For some brilliant reason they made a #define for EOF and I had to undef it in the engine headers. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
ErhanK Posted January 28, 2020 Author Share Posted January 28, 2020 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() Quote Link to comment Share on other sites More sharing options...
Josh Posted January 28, 2020 Share Posted January 28, 2020 Something like this will work (from memory): auto s = LoadString("myfile.txt"); auto sarr = String::Split(s,"|"); 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.