[Include] e_file ● Advance & Fastest INI file manager ● Version 1
#1

e_file
Version 1
Update: 26 June, 2013









Credits
- Excel
- dFiles Creator










Description
Hello SAMP users. Today i present you the best, not the best but the better version of samp INI manager include. This include is made by me taken help from dFile include too. This is really advance INI manager and you can do almost everything you need to do with File stuff. Checkout down part for more info. about this whole e_file include. Thanks for reading.









Natives
pawn Code:
native efile_create(location[]);
native efile_delete(location[]);

native efile_open(location[]);
native efile_close();

native efile_writestring(parameter[], value[]);
native efile_writeint(parameter[], value[]);
native efile_writebool(parameter[], bool:value);
native efile_writefloat(parameter[], Float.value);

native efile_multiset(type[],{Float,_}:...);
native efile_multiget(type[],{Float,_}:...);

native efile_readstring(parameter[]);
native efile_readint(parameter[]);
native efile_readfloat(parameter[]);
native efile_readbool(parameter[]);

native efile_movefile(location[], newlocation[]);
native efile_renamefile(location[], newname[]);
native efile_savefile();
native efile_exists(location[]);

native efile_isset(parameter[]);
native efile_unset(parameter[]);

native efile_parsestring(parameter[], value[]);
native efile_parseint(parameter[], value[]);
native efile_parsefloat(parameter[], Float:value);
native efile_parsebool(parameter[], bool:value);

PART 2: (No needed)
The part left for Version 2 is been not included in this version. If you open the script, You will see there. Those function work but still I haven't tested them so can say anything. If you think they work then please PM / Reply about them. You will get credits for that .
Not included functions:
pawn Code:
//  ---------------> Not used <---------------
native efile_parsestring(parameter[], ertek[]);
native dfile_ParseInt(parameter[], ertek[]);
native dfile_ParseFloat(parameter[], Float:ertek);
native dfile_ParseBool(parameter[], bool:ertek);
^^ OH! Sorry vut that part, I have tested now and Comparison of values is working now, Added all functions now, ENJOY!









Tutorial
efile_create(location[]);
Usage: Creates a new file in a specified directory.
Example:
pawn Code:
efile_create("Pot.ini");
Explanation: This code will create an ini file in "Scriptfiles/Pot.ini".



efile_delete(location[]);
Usage: Deletes an already existing ini file.
Example:
pawn Code:
efile_delete("Pot.ini");
Explanation: This code will delete the ini file from "Scriptfiles/Pot.ini".



efile_open(location[]);
Usage: Opens an already existing ini file.
Example:
pawn Code:
efile_create("Pot.ini"); //I am re-creating cause i deleted it earlier.
efile_open("Pot.ini");
Explanation: This code will open the ini file from "Scriptfiles/Pot.ini".



efile_close();
Usage: If a file is opened, this will close it.
Example:
pawn Code:
efile_close();
Explanation: This code will close the ini file previously open from "Scriptfiles/Pot.ini".



efile_writestring(parameter[], value[]);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_WriteString("3Dtext", "blah!");
Explanation: This code will write a string value to an ini file which is opened.



efile_writeint(parameter[], value);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_writeint("PlayerMoney", GetPlayerMoney(playerid));
Explanation: This code will write a integer value(Player's Money) to an ini file which is opened.



efile_writebool(parameter[], bool:value);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_writebool("PlayerHasHands", true);
Explanation: This code will write a booling value(true) to an ini file which is opened.



efile_writefloat(parameter[], Float.value);
Usage: Writes a floating value to the given parameter with a value.
Example:
pawn Code:
efile_writefloat("PlayerHealth", 11111.0); // God mode
Explanation: This code will write a floating value to an ini file which is opened.



efile_multiset(type[],{Float,_}:...);
Usage: Writes multiple values with multiple parameters, This is an advance thing.
Example:
pawn Code:
efile_multiset("ssddfbs",
        "test1", "something",
        "test2", "everything",
        "test3", 30,
        "test4", 50,
        "test5", 36.23425,
        "test6", true,
        "test7", "anything"
    );
Explanation: This code will write multiple values to multiple parameters to an ini file which is opened.



efile_multiget(type[],{Float,_}:...);
Usage: Get multiple values with multiple parameters, This is an advance thing too.
Example:
pawn Code:
efile_multiset("ssddfbs",
        "test1", variable1,//String
        "test2", variable2,//String
        "test3", variable3,//Integer
        "test4", variable4,//Integer
        "test5", variable5,//Float
        "test6", variable6,//Bool
        "test7", variable7//String
    );
Explanation: This code will get multiple values from multiple parameters to an ini file which is opened.



efile_readstring(parameter[]);
Usage: Reads a string value from the stated parameter.
Example:
pawn Code:
efile_readstring("3Dtext");
Explanation: This code will read a string value from the stated parameter like from here we get the string "Blah!" which we wrote earlier.



efile_readint(parameter[]);
Usage: Reads a integer value from the stated parameter.
Example:
pawn Code:
efile_readint("PlayerMoney");
Explanation: This code will read a integer value from the stated parameter like from here we get the integer "GetPlayerMoney(playerid)" which we wrote earlier.



efile_readfloat(parameter[]);
Usage: Reads a floating value from the stated parameter.
Example:
pawn Code:
efile_readfloat("PlayerHelath");
Explanation: This code will read a floating value from the stated parameter like from here we get the health "11111.0" which we wrote earlier.



efile_readbool(parameter[]);
Usage: Reads a booling value from the stated parameter.
Example:
pawn Code:
efile_readbool("PlayerHasHands");
Explanation: This code will read a booling value from the stated parameter like from here we get the "true" which we wrote earlier.



efile_movefile(location[], newlocation[]);
Usage: Moves an existing file from given location to a new one.
Example:
pawn Code:
efile_movefile("Pot.ini", "Pot2.ini");
Explanation: This code will move the file "Pot.ini" to "Pot2.ini".



efile_renamefile(location[], newname[]);
Usage: Renames an existing file from given location with a newname.
Example:
pawn Code:
efile_renamefile("Pot.ini", "BigPot.ini");
Explanation: This code will rename the file "Pot.ini" to "BigPot.ini".



efile_savefile();
Usage: This function is very useful, after you have writed a file, you must save it by this stock.



efile_exists(location[]);
Usage: Checks whether the file exists or not.
Example:
pawn Code:
efile_exists("BigPot.ini");
Explanation: This code will check whether "BigPot.ini" directory exists in Scriptfiles or not.



efile_isset(parameter[]);
Usage: Checks whether the parameter has value or not.



efile_unset(parameter[]);
Usage: Delets the value in the parameter.
Example:
pawn Code:
efile_unset("PlayerHelath");
Explanation: This code will Reset the value of parameter "PlayerHealth" if existing.




efile_unset(parameter[]);
Usage: Delets the value in the parameter.
Example:
pawn Code:
efile_unset("PlayerHelath");
Explanation: This code will Reset the value of parameter "PlayerHealth" if existing.




efile_parsestring(parameter[], value[]);
Usage: Compares the string value from parameters against Value writen.
Example:
pawn Code:
efile_parsestring("3Dtext", "value");
Explanation: This code will compare "3Dtext" value against "value" written.




efile_parseint(parameter[], value[]);
Usage: Compares the integer value from parameters against Value writen.




efile_parsefloat(parameter[], value[]);
Usage: Compares the floating value from parameters against Value writen.




efile_parsebool(parameter[], value[]);
Usage: Compares the booling value from parameters against Value writen.






NOTE: This info. will help you to use Code "efile_multiset":
"s" - string
"d" - integer
"b" - boolean
"f" - float










Download
PASTEBIN
Reply
#2

Awesome.
Reply
#3

Thanks sir, keep up the good work!
Reply
#4

Your welcome ^^
Reply
#5

I really doubt its the fastest.. speed tests?
Reply
#6

no speedtests, comparsions , no proof>? how is it fastest ?
Reply
#7

Your documentation includes "native"s, even though your include does not even have any single "native" included at all.
And how I am supposed to create multiple file streams, by using your include?
Reply
#8

Looks nice, ill test it later
Reply
#9

I got impressed at
pawn Code:
native efile_multiset(type[],{Float,_}:...);
and I lost you at
Quote:
Originally Posted by Niko_boy
View Post
no speedtests, comparsions , no proof>? how is it fastest ?
Why use this instead of Y_ini (the existing fastest INI system)?
Reply
#10

OK sorry I forgot speed tests, wait for few time till I get the speed tests. Currently I am busy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)