Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/example/customization/codegen.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 894 bytes
Line 
1// (C) Copyright Vladimir Prus, 2003
2// Distributed under the Boost Software License, Version 1.0. (See
3// accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5
6// Please see 'usage.verbatim' file for usage notes.
7
8#include <iostream>
9#include <string>
10#include <cstring>
11using std::cout;
12using std::string;
13using std::strlen;
14
15extern const char class_template[];
16extern const char usage[];
17
18int main(int ac, char* av[])
19{
20    if (av[1]) {       
21
22        string class_name = av[1];
23        string s = class_template;
24       
25        string::size_type n;
26        while((n = s.find("%class_name%")) != string::npos) {
27            s.replace(n, strlen("%class_name%"), class_name);
28        }
29        std::cout << "Output is:\n";
30        std::cout << s << "\n";       
31        return 0;
32    } else {
33        std::cout << usage << "\n";
34        return 1;
35    }
36}
Note: See TracBrowser for help on using the repository browser.