Mercurial > code
changeset 360:469000c78227
- Rename tools
- Move them to specific directories
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 28 Apr 2015 11:22:13 +0200 |
parents | c6dfa16c77be |
children | 412c3e26bb40 |
files | CMakeLists.txt tools/CMakeLists.txt tools/cat/CMakeLists.txt tools/cat/cat.cpp tools/cccat.cpp tools/linktool/CMakeLists.txt tools/linktool/linktool.cpp tools/mdtohtml.cpp |
diffstat | 8 files changed, 116 insertions(+), 78 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Tue Apr 28 11:16:46 2015 +0200 +++ b/CMakeLists.txt Tue Apr 28 11:22:13 2015 +0200 @@ -101,7 +101,7 @@ OUTPUT ${output} FROM markdown TO html5 MAKE_DIRECTORY STANDALONE - FILTER $<TARGET_FILE:mdtohtml> + FILTER $<TARGET_FILE:cclinktool> ) list(APPEND docoutputlist ${output})
--- a/tools/CMakeLists.txt Tue Apr 28 11:16:46 2015 +0200 +++ b/tools/CMakeLists.txt Tue Apr 28 11:22:13 2015 +0200 @@ -18,6 +18,6 @@ project(tools) -add_executable(cccat cccat.cpp) -add_executable(mdtohtml mdtohtml.cpp) +add_subdirectory(cat) +add_subdirectory(linktool) add_subdirectory(mkunicode)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/cat/CMakeLists.txt Tue Apr 28 11:22:13 2015 +0200 @@ -0,0 +1,19 @@ +# +# CMakeLists.txt -- code building for common code +# +# Copyright (c) 2013, 2014 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +add_executable(cccat cat.cpp) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/cat/cat.cpp Tue Apr 28 11:22:13 2015 +0200 @@ -0,0 +1,37 @@ +/* + * cccat.cpp -- very basic cat replacement for portability + * + * Copyright (c) 2013, 2014, 2015 David Demelier <markand@malikania.fr> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <algorithm> +#include <fstream> +#include <iostream> +#include <iterator> + +using namespace std; + +int main(int argc, char **argv) +{ + if (argc < 2) { + cerr << "usage: cccat file" << endl; + exit(1); + } + + ifstream input(argv[1]); + copy(istreambuf_iterator<char>(input), istreambuf_iterator<char>(), ostreambuf_iterator<char>(cout)); + + return 0; +} \ No newline at end of file
--- a/tools/cccat.cpp Tue Apr 28 11:16:46 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * cccat.cpp -- very basic cat replacement for portability - * - * Copyright (c) 2013, 2014, 2015 David Demelier <markand@malikania.fr> - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <algorithm> -#include <fstream> -#include <iostream> -#include <iterator> - -using namespace std; - -int main(int argc, char **argv) -{ - if (argc < 2) { - cerr << "usage: cccat file" << endl; - exit(1); - } - - ifstream input(argv[1]); - copy(istreambuf_iterator<char>(input), istreambuf_iterator<char>(), ostreambuf_iterator<char>(cout)); - - return 0; -} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/linktool/CMakeLists.txt Tue Apr 28 11:22:13 2015 +0200 @@ -0,0 +1,19 @@ +# +# CMakeLists.txt -- code building for common code +# +# Copyright (c) 2013, 2014 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +add_executable(cclinktool linktool.cpp) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/linktool/linktool.cpp Tue Apr 28 11:22:13 2015 +0200 @@ -0,0 +1,38 @@ +/* + * mdtohtml.cpp -- convert .md links to .html for local documentation + * + * Copyright (c) 2013, 2014 David Demelier <markand@malikania.fr> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <algorithm> +#include <iostream> +#include <string> + +using namespace std; + +int main(void) +{ + string content; + string::size_type pos; + + copy(istreambuf_iterator<char>(cin), istreambuf_iterator<char>(), back_inserter(content)); + + while ((pos = content.find(".md")) != string::npos) + content.replace(pos, 3, ".html"); + + copy(content.begin(), content.end(), ostreambuf_iterator<char>(cout)); + + return 0; +}
--- a/tools/mdtohtml.cpp Tue Apr 28 11:16:46 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * mdtohtml.cpp -- convert .md links to .html for local documentation - * - * Copyright (c) 2013, 2014 David Demelier <markand@malikania.fr> - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <algorithm> -#include <iostream> -#include <string> - -using namespace std; - -int main(void) -{ - string content; - string::size_type pos; - - copy(istreambuf_iterator<char>(cin), istreambuf_iterator<char>(), back_inserter(content)); - - while ((pos = content.find(".md")) != string::npos) - content.replace(pos, 3, ".html"); - - copy(content.begin(), content.end(), ostreambuf_iterator<char>(cout)); - - return 0; -}