Jump to content

  • Log In with Google      Sign In   
  • Create Account

Two Open Source (BSD) utilities I wrote


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
11 replies to this topic

#1 Starfox   Members   -  Reputation: 504

Like
1Likes
Like

Posted 12 January 2011 - 04:47 PM

I recently cleaned up and uploaded a couple of small utilities I wrote to help me with work to BitBucket. The first, "Text to C String", takes a text file as input and outputs a string suitable for embedding in a C[++] file. I use it to embed shaders into my code as const char*s, so that small demo apps I write end up self contained. The second, "Binary to C Array", does a similar thing for binary files - it turns them into an unsigned char array (like "{ 0x0A, 0x07, 0x1B }") suitable for embedding in a source file. I use this to embed other binary dependencies like Ogg files into my exe, again for the sake of having a single simple, self contained application. I hope someone would find them useful.

Text to C String


Binary to C Array

Holy crap I started a blog - http://unobvious.typepad.com/

Sponsor:

#2 mind_wipe   Members   -  Reputation: 100

Like
0Likes
Like

Posted 12 January 2011 - 11:16 PM

Those are cool! I make little utilities like those all the time. I'm glad to see someone else does this too, so now I don't feel so weird. I've had this great idea for a data packager or archiver utility with script-able inputs and outputs. Similar to your programs, this would read a script or XML definition of a file format and rip the contents to another. Useful for file conversions. But... like most pet projects of mine, it will most likely never get built because I play to many video games and other stuff.

#3 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 13 January 2011 - 01:47 AM

Thanks. I have a ton of things like that, and I decided to start open sourcing them bit by bit based on dependencies. Hope other people find them useful.
Holy crap I started a blog - http://unobvious.typepad.com/

#4 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 13 January 2011 - 11:08 PM

BTW, if someone could add build tools files for OS X or other platforms, please do!
Holy crap I started a blog - http://unobvious.typepad.com/

#5 fastcall22   Crossbones+   -  Reputation: 4461

Like
0Likes
Like

Posted 14 January 2011 - 01:06 AM

BTW, if someone could add build tools files for OS X or other platforms, please do!


Huh? It looks to be standard C++; just pop the source file in a default console project from your favorite IDE and hit compile.
c3RhdGljIGNoYXIgeW91cl9tb21bMVVMTCA8PCA2NF07CnNwcmludGYoeW91cl9tb20sICJpcyBmYXQiKTs=

#6 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 14 January 2011 - 01:41 AM

Yup, I take great care to write ANSI C++. I want to save people the "pop the source file in a default console project" step with popular IDEs / build platforms. CMake and XCode files would be awesome.
Holy crap I started a blog - http://unobvious.typepad.com/

#7 phresnel   Members   -  Reputation: 949

Like
0Likes
Like

Posted 14 January 2011 - 02:36 AM

Yup, I take great care to write ANSI C++. I want to save people the "pop the source file in a default console project" step with popular IDEs / build platforms. CMake and XCode files would be awesome.


CMake files and XCode files are two orthogonal topics. CMake is a meta-makefile-thingy that can generate a wide range of "project-files", like good old makefiles, xcode files, msvc files, etc.

I can only recommend to get in touch with stuff like CMake, autotools, qmake. It is valuable knowledge.

#8 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 14 January 2011 - 03:31 PM

I'm quite familiar with CMake, but I haven't seen it able to produce Visual Studio files with the customizations I need, and I assumed XCode and VS would deserve custom files made since they cover a wide standardized market share. Autotools and qmake need to be taken out back and shot.
Holy crap I started a blog - http://unobvious.typepad.com/

#9 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

Posted 15 January 2011 - 08:40 AM

You might also be interested in a little project I made, which does similar things: http://bitbucket.org/edd/embd
You give it a list of files on the command line and it generates a source/header pair, which you can compile and link in to your application in order to access the embedded files as std::istreams or byte-iterator ranges.

#10 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 15 January 2011 - 04:13 PM

The original version of those started out VERY similar to embd. I made this new version to be simpler, lighter weight and easy to integrate in a pipeline with stdin / stdout redirection. We seem to share a lot of views though, and I have to say that you're one of the very, VERY few people I've seen who actually understand C++.
Holy crap I started a blog - http://unobvious.typepad.com/

#11 farcodev   Members   -  Reputation: 160

Like
0Likes
Like

Posted 15 January 2011 - 09:47 PM

Thanks for the sharing
---------------------------------
FAR Colony http://farcolony.blogspot.com/

#12 Starfox   Members   -  Reputation: 504

Like
0Likes
Like

Posted 17 January 2011 - 02:10 AM

You're welcome. Use, abuse and provide feedback!
Holy crap I started a blog - http://unobvious.typepad.com/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS