Where there's a place for everything (ok, maybe not EVERYTHING, but close to everything at least).

Tech & World News, Computer Stuff, Martial Arts, Sports, Music, etc. in one single place.


    ConvertEnumToStrings

    Coolname007
    Coolname007
    ETS Director
    ETS Director

    Posts : 629
    Join date : 2009-07-15
    Location : Half-way between nowhere and somewhere

    ConvertEnumToStrings Empty ConvertEnumToStrings

    Post by Coolname007 on Sun May 09, 2010 8:19 pm

    I am currently working on a very simple C++ CLI program, which can convert enumeration types to strings. This program will be useful on a much bigger project that I am working on right now (more specifically, a program which will make web coding in various languages a snap).

    I will upload the source and header files of the simpler program, and post the links in this thread, once its done.

    Cheers.

    sunny


    Last edited by Coolname007 on Thu Jun 03, 2010 11:20 pm; edited 1 time in total


    _________________
    ETS:
    Where tech meets traditional, and ideas merge to form one single entity.
    ConvertEnumToStrings Ets_fo21
    Help ETS by joining today, and contributing content! Your help is very much appreciated.

    Jake Johnson - Site Admin/Owner

    Founder of Expert Technology Storehouse .
    Coolname007
    Coolname007
    ETS Director
    ETS Director

    Posts : 629
    Join date : 2009-07-15
    Location : Half-way between nowhere and somewhere

    ConvertEnumToStrings Empty Re: ConvertEnumToStrings

    Post by Coolname007 on Thu Jun 03, 2010 11:18 pm

    I finished it. Glee


    Instructions:

    Download the .zip file containing the source and header files for ConvertEnumToStrings from this link .
    Extract everything from the .zip to somewhere on your hard drive, being sure to retain the directory structures.
    Add the sources and headers found in the "ConvertEnumToStrings" directory and all sub-directories to a new project file created in whatever IDE you use (I use Code::Blocks).
    Make sure your IDE is set to link.
    Build the project. It should compile without any errors.
    You should now have an executable you can run from whatever target directory you compiled it in.
    Now open up a Terminal or Command Prompt (depending on whether you're in Linux or Windows), or whatever name the command-line program is in your OS.
    Through the command-line, navigate to the directory (using the "cd" command or similiar) the "ConvertEnumToStrings" executable is in.
    Once there, run this if in Windows:
    Code:

    ConvertEnumToStrings.exe --help

    to get a description of how to use the program.

    Or this if in Linux:

    Code:
    ./ConvertEnumToStrings --help

    to get a description of how to use the program.
    Read what it says and respond accordingly.
    You should now be able to pass into the program an existing file with an enum in it, and have the program generate a header or source file (header by default) for you providing the method(s) to get different enum elements automatically, including the enum name, a vector<string> of all the enumerators' names, a vector<int> of the enumerators' values, a map<string, int> of all the enumerators mapped to their numerical values, or the number of enumerators.

    Cheers.

    guitar


    _________________
    ETS:
    Where tech meets traditional, and ideas merge to form one single entity.
    ConvertEnumToStrings Ets_fo21
    Help ETS by joining today, and contributing content! Your help is very much appreciated.

    Jake Johnson - Site Admin/Owner

    Founder of Expert Technology Storehouse .

      Current date/time is Wed Nov 13, 2019 8:28 pm