
-----------------------------------
Justin_
Thu Aug 17, 2006 1:24 am

keeping format of text file?
-----------------------------------
How does one edit a text file programmatically (replace some things in it) while keeping all the formatters in place.  i.e. the file looks the exact same as before.

Man, I am outputting to the file with copy but that is bad, bad bad.  It is a source text file and it needs to be in a shape to compile.

-----------------------------------
wtd
Thu Aug 17, 2006 11:20 am


-----------------------------------
Don't blame the method of output.  Show us how you are editing it.

Providing a tiny amount of information about the problem is not the best way to get useful suggestions.

-----------------------------------
Justin_
Thu Aug 17, 2006 1:53 pm


-----------------------------------

//////This code was generated by Justin Moser's brain/////////
/*/@@@@@ issues: can't format the new source code of the stub.
*/
#include 
#include 
#include 
#include 
#include 
#include "file.h"

std::string source_edit(std::string input);
//source_edit edits the stub source.  This was the only way I knew how to make a dynamic
//stub
/////////////////////////////////////////////////////////////////////////////////
void generate_stub();
//generate_stub uses the source_edit function to make a fitting stub, then it compiles it
//////////////////////////////////////////////////////////////////////////////

std::vector fileVector;   //this is not good!  I had to do this to supply a unary function
//to the transform algorithm in generate_stub()  I intend to fix this once I conceive of a way.
int main(int argc, char** argv)
{
   if (argc < 3)
   {
      std::cerr 