Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    2
  • comments
    0
  • views
    2331

About this blog

All about the code.

Entries in this blog

 

Awsome INI Gets a New Lease on Life

I'm publishing an update for Awesome INI Loader library. The library now has a new license, WTFPL. So now you may use the library for anything you wish. Why I changed it to this is because I believe code shared to the world, should be able to be modified and used by anyone with or without permission. I know some may differ, but I write code because it's fun, and I want to help the smaller guys out.

And for anyone who isn't familiar with this library:
This library will load, parse, error check, INI files, while giving the programmer full customization easily, leave small memory footprint, easy to port to any platform, and easy to add to any C++ project. The library has extremely small requirements, and will run on most C++ compilers. Great for small and big projects and gets weekly or monthly updates.

The library has a few new functions! Telling from the image, error checking and getting the data you want is 2x much simpler and faster now that the library supports these new functions...[code=:0] bool getKeyInt(int &p, const char* group, const char* key); bool getKeyBool(bool &p, const char* group, const char* key); bool getKeyString(char* dstBuffer, const char* group, const char* key); bool getKeyFloat(float &p, const char* group, const char* key);
The code is pretty much self explanatory, but I'll give a small run down...

The first arguments are the variables or buffers you wish to pass to store the data. Arguments 2 and 3 are the group and key you wish to retrieve. If everything goes well, the functions will return true, and you dont have to check the error function. Otherwise if it does you may need see whats going on.

I've also added a little documentation to the error codes in the source code in "awesome_ini.h".

ajm113

ajm113

 

Awesome INI Loader C++ Library Launches

Hello everyone! I would like to introduce my INI library parser. I wrote from scratch and would like to thank the community for their help, writing this library. So whats so good about this library?
Lightweight small memory footprint.
Easy to modify
BSD License
Pure C++ mixed with C. (Easy to port)
Multiplatform
Easy to use error handling system.
One pointer does all.
Easy to setup with any project.
Easy to customize to your project needs. (Want to use "#" for comments? Change separator? Edit one line of code!)

Im really looking for some testers and input to make this project better for everyone for any application big and small!

Example code:#include "awesome_ini.h"int _tmain(int argc, _TCHAR* argv[]){ awesome_ini* myIni = new awesome_ini("test.ini"); AWESOME_ERROR_CODES r = myIni->getError(); size_t l = myIni->getErrorLine(); if (r == AWESOME_ERROR_NONE) { printf("Loaded ini!\n"); } else { printf("Failed! %i %i\n", r, l); } char value[AWI_MAX_VALUE_NAME_LENGTH]; AWESOME_INI_KEY_TYPE t = myIni->getKey(value, "test", "hello"); printf("Variable Type: %i - Variable Value: %s\n", t, value); getchar(); return 0;}
If anyone has any questions or would like to help port this library to other languages let me know!

http://sourceforge.net/projects/awesomeiniloader/

Thank you!

ajm113

ajm113

ajm113

Sign in to follow this  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!