Mxx_ru 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. data/COPYING +26 -26
  2. data/NEWS +107 -107
  3. data/README +21 -21
  4. data/Rakefile +56 -59
  5. data/examples/exe_and_lib/prj.rb +11 -11
  6. data/examples/exe_and_lib/say.rb +7 -7
  7. data/examples/exe_dll_lib/inout.rb +18 -18
  8. data/examples/exe_dll_lib/prj.rb +11 -11
  9. data/examples/exe_dll_lib/say.rb +9 -9
  10. data/examples/exe_dll_lib_2/build.rb +10 -10
  11. data/examples/exe_dll_lib_2/inout/prj.rb +16 -16
  12. data/examples/exe_dll_lib_2/main/prj.rb +9 -9
  13. data/examples/exe_dll_lib_2/say/prj.rb +8 -8
  14. data/examples/simple_exe/prj.rb +7 -7
  15. data/lib/mxx_ru/abstract_target.rb +335 -335
  16. data/lib/mxx_ru/binary_library.rb +106 -106
  17. data/lib/mxx_ru/binary_target.rb +173 -173
  18. data/lib/mxx_ru/binary_unittest.rb +143 -143
  19. data/lib/mxx_ru/compat.rb +33 -33
  20. data/lib/mxx_ru/cpp.rb +38 -38
  21. data/lib/mxx_ru/cpp/analyzer.rb +237 -237
  22. data/lib/mxx_ru/cpp/composite.rb +118 -118
  23. data/lib/mxx_ru/cpp/detect_toolset.rb +122 -122
  24. data/lib/mxx_ru/cpp/mode.rb +90 -90
  25. data/lib/mxx_ru/cpp/obj_placement.rb +330 -330
  26. data/lib/mxx_ru/cpp/obj_placements/custom_subdir.rb +155 -155
  27. data/lib/mxx_ru/cpp/qt.rb +366 -366
  28. data/lib/mxx_ru/cpp/rucodegen.rb +157 -157
  29. data/lib/mxx_ru/cpp/source_file.rb +79 -79
  30. data/lib/mxx_ru/cpp/target.rb +1523 -1523
  31. data/lib/mxx_ru/cpp/toolset.rb +1087 -1087
  32. data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +53 -53
  33. data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +460 -460
  34. data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +59 -59
  35. data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +59 -59
  36. data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +277 -277
  37. data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +58 -58
  38. data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +420 -424
  39. data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +64 -64
  40. data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +150 -150
  41. data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +91 -91
  42. data/lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb +103 -84
  43. data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -62
  44. data/lib/mxx_ru/cpp/toolsets/vc8.rb +455 -455
  45. data/lib/mxx_ru/cpp/toolsets/vc_family.rb +448 -448
  46. data/lib/mxx_ru/ex.rb +165 -165
  47. data/lib/mxx_ru/makestyle_generator.rb +146 -146
  48. data/lib/mxx_ru/textfile_unittest.rb +303 -303
  49. data/lib/mxx_ru/util.rb +340 -340
  50. data/tests/c/pcre/chartables.c +183 -183
  51. data/tests/c/pcre/config.h +99 -99
  52. data/tests/c/pcre/dftables.c +167 -167
  53. data/tests/c/pcre/get.c +349 -349
  54. data/tests/c/pcre/internal.h +677 -677
  55. data/tests/c/pcre/maketables.c +140 -140
  56. data/tests/c/pcre/pcre.c +8304 -8304
  57. data/tests/c/pcre/pcre.h +193 -193
  58. data/tests/c/pcre/pcre.rb +14 -14
  59. data/tests/c/pcre/pcredemo.c +316 -316
  60. data/tests/c/pcre/pcregrep.c +642 -642
  61. data/tests/c/pcre/pcreposix.c +305 -305
  62. data/tests/c/pcre/pcreposix.h +88 -88
  63. data/tests/c/pcre/pcretest.c +1483 -1483
  64. data/tests/c/pcre/perltest +211 -211
  65. data/tests/c/pcre/printint.c +360 -360
  66. data/tests/c/pcre/study.c +472 -472
  67. data/tests/cpp/cpp_sources_glob/build.rb +7 -7
  68. data/tests/cpp/cpp_sources_glob/some/module/prj.rb +10 -10
  69. data/tests/cpp/cpp_sources_glob/tc_cpp_sources_glob.rb +18 -18
  70. data/tests/cpp/mswin_res_dll/build.rb +14 -14
  71. data/tests/cpp/mswin_res_dll/dll.cpp +17 -17
  72. data/tests/cpp/mswin_res_dll/dll.rb +29 -29
  73. data/tests/cpp/mswin_res_dll/dll.rc +48 -48
  74. data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -8
  75. data/tests/cpp/mswin_res_dll/h/res.h +3 -3
  76. data/tests/cpp/mswin_res_dll/main.cpp +13 -13
  77. data/tests/cpp/mswin_res_dll/main.rb +19 -19
  78. data/tests/cpp/mswin_res_dll/tc_mswin_res_dll.rb +18 -18
  79. data/tests/cpp/mswin_res_exe/build.rb +23 -23
  80. data/tests/cpp/mswin_res_exe/h/res.h +3 -3
  81. data/tests/cpp/mswin_res_exe/main.cpp +17 -17
  82. data/tests/cpp/mswin_res_exe/main.rc +48 -48
  83. data/tests/cpp/mswin_res_exe/tc_mswin_res_exe.rb +18 -18
  84. data/tests/cpp/rucodegen.embedded/host_config.cpp +32 -32
  85. data/tests/cpp/rucodegen.embedded/impl/conn_params.cpp +7 -7
  86. data/tests/cpp/rucodegen.embedded/impl/conn_params.rb +14 -14
  87. data/tests/cpp/rucodegen.embedded/impl/h/conn_params.hpp +10 -10
  88. data/tests/cpp/rucodegen.embedded/prj.rb +16 -16
  89. data/tests/cpp/rucodegen.embedded/tc_rucodegen.rb +18 -18
  90. data/tests/cpp/rucodegen/host_config.cpp +20 -20
  91. data/tests/cpp/rucodegen/host_config.rb +14 -14
  92. data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -7
  93. data/tests/cpp/rucodegen/impl/conn_params.rb +14 -14
  94. data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -10
  95. data/tests/cpp/rucodegen/prj.rb +16 -16
  96. data/tests/cpp/rucodegen/tc_rucodegen.rb +18 -18
  97. data/tests/cpp/textfile_unittest/build.rb +8 -8
  98. data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -1
  99. data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -128
  100. data/tests/cpp/textfile_unittest/main.cpp +89 -89
  101. data/tests/cpp/textfile_unittest/prj.rb +8 -8
  102. data/tests/cpp/textfile_unittest/prj.ut.rb +18 -18
  103. data/tests/cpp/textfile_unittest/tc_textfile_unittest.rb +18 -18
  104. data/tests/cpp/toolset_name.rb +6 -6
  105. data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -10
  106. data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -11
  107. data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -11
  108. data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -14
  109. data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -10
  110. data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -11
  111. data/tests/cpp/vc_cleanup/prj_lib.rb +10 -10
  112. data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -11
  113. data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +23 -23
  114. data/tests/mxx_ru/binary_library/tc_binary_library.rb +57 -57
  115. data/tests/mxx_ru/binary_library/tc_binary_target_lib_methods.rb +114 -114
  116. data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -8
  117. data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -5
  118. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -7
  119. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -5
  120. data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -5
  121. data/tests/mxx_ru/change_default_value/ok/build.rb +8 -8
  122. data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -8
  123. data/tests/mxx_ru/lib_path/build.rb +8 -8
  124. data/tests/mxx_ru/lib_path/bye.rb +8 -8
  125. data/tests/mxx_ru/lib_path/hi.rb +8 -8
  126. data/tests/mxx_ru/lib_path/main.rb +12 -12
  127. data/tests/mxx_ru/lib_path/tc_lib_path.rb +18 -18
  128. data/tests/mxx_ru/obj_placements/tc_custom_subdir.rb +58 -58
  129. data/tests/mxx_ru/opt_lib_ext/build.rb +7 -7
  130. data/tests/mxx_ru/opt_lib_ext/hi.rb +7 -7
  131. data/tests/mxx_ru/opt_lib_ext/tc_opt_lib_ext.rb +18 -18
  132. data/tests/mxx_ru/opt_lib_ext/test-no-ext.rb +9 -9
  133. data/tests/mxx_ru/opt_lib_ext/test-with-ext.rb +13 -13
  134. data/tests/mxx_ru/plural_form_methods/tc.rb +72 -72
  135. data/tests/mxx_ru/qt_gen/tc_uic_result_subdir.rb +76 -76
  136. data/tests/mxx_ru/target_ext/prj_dll.rb +8 -8
  137. data/tests/mxx_ru/target_ext/prj_exe.rb +8 -8
  138. data/tests/mxx_ru/target_ext/prj_lib.rb +8 -8
  139. data/tests/mxx_ru/target_ext/tc_target_ext.rb +24 -24
  140. data/tests/mxx_ru/tc_makestyle_generator.rb +117 -117
  141. data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -230
  142. data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -104
  143. data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -17
  144. data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -173
  145. data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -16
  146. data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -81
  147. data/tests/mxx_ru/vc8/ts_vc8.rb +10 -10
  148. data/tests/qt/aclock/aclock.cpp +148 -148
  149. data/tests/qt/aclock/aclock.h +45 -45
  150. data/tests/qt/aclock/main.cpp +28 -28
  151. data/tests/qt/aclock/prj.rb +21 -21
  152. data/tests/qt/iconview/main.cpp +76 -76
  153. data/tests/qt/iconview/prj.rb +21 -21
  154. data/tests/qt/toplevel/main.cpp +9 -9
  155. data/tests/qt/toplevel/options.ui +587 -587
  156. data/tests/qt/toplevel/prj.rb +22 -22
  157. data/tests/test_with_compilation.rb +110 -110
  158. data/tests/unix/lib_linking_mode/a_shared.rb +7 -7
  159. data/tests/unix/lib_linking_mode/a_static.rb +7 -7
  160. data/tests/unix/lib_linking_mode/etalon/shared.txt +2 -2
  161. data/tests/unix/lib_linking_mode/etalon/static.txt +2 -2
  162. data/tests/unix/lib_linking_mode/main_conflict.rb +12 -12
  163. data/tests/unix/lib_linking_mode/main_conflict_2.rb +11 -11
  164. data/tests/unix/lib_linking_mode/main_shared.rb +9 -9
  165. data/tests/unix/lib_linking_mode/main_shared.ut.rb +11 -11
  166. data/tests/unix/lib_linking_mode/main_shared_2.rb +10 -10
  167. data/tests/unix/lib_linking_mode/main_shared_2.ut.rb +11 -11
  168. data/tests/unix/lib_linking_mode/main_static.rb +9 -9
  169. data/tests/unix/lib_linking_mode/main_static.ut.rb +11 -11
  170. data/tests/unix/lib_linking_mode/main_static_2.rb +10 -10
  171. data/tests/unix/lib_linking_mode/main_static_2.ut.rb +11 -11
  172. data/tests/unix/lib_linking_mode/tc_conflicted_build.rb +18 -18
  173. data/tests/unix/lib_linking_mode/tc_normal_build.rb +18 -18
  174. data/tests/unix/lib_order/a.cpp +4 -0
  175. data/tests/unix/lib_order/a.hpp +1 -0
  176. data/tests/unix/lib_order/a.rb +8 -0
  177. data/tests/unix/lib_order/b.cpp +10 -0
  178. data/tests/unix/lib_order/b.hpp +1 -0
  179. data/tests/unix/lib_order/b.rb +8 -0
  180. data/tests/unix/lib_order/build.rb +9 -0
  181. data/tests/unix/lib_order/c.cpp +12 -0
  182. data/tests/unix/lib_order/c.hpp +2 -0
  183. data/tests/unix/lib_order/c.rb +8 -0
  184. data/tests/unix/lib_order/d.cpp +7 -0
  185. data/tests/unix/lib_order/d.hpp +1 -0
  186. data/tests/unix/lib_order/d.rb +8 -0
  187. data/tests/unix/lib_order/main.cpp +7 -0
  188. data/tests/unix/lib_order/main.rb +14 -0
  189. data/tests/unix/lib_order/tc_normal_build.rb +16 -0
  190. metadata +342 -319
@@ -1,7 +1,7 @@
1
- #include "h/conn_params.hpp"
2
-
3
- namespace impl
4
- {
5
- #include "conn_params.impl.cpp"
6
- }
7
-
1
+ #include "h/conn_params.hpp"
2
+
3
+ namespace impl
4
+ {
5
+ #include "conn_params.impl.cpp"
6
+ }
7
+
@@ -1,14 +1,14 @@
1
- require 'rubygems'
2
- require_gem 'RuCodeGen'
3
-
4
- cpp_value_incapsulator :conn_params_t do |c|
5
- c.decl_file :script_relative => "h/conn_params.impl.hpp"
6
- c.impl_file :script_relative => "conn_params.impl.cpp"
7
-
8
- c.attr_suffix "_"
9
-
10
- c.attr :attempts, "int", :default => 3
11
- c.attr :reconnect_timeout, "int", :default => 10
12
- c.attr :restore_timeout, "int", :default => 5
13
- end
14
-
1
+ require 'rubygems'
2
+ require_gem 'RuCodeGen'
3
+
4
+ cpp_value_incapsulator :conn_params_t do |c|
5
+ c.decl_file :script_relative => "h/conn_params.impl.hpp"
6
+ c.impl_file :script_relative => "conn_params.impl.cpp"
7
+
8
+ c.attr_suffix "_"
9
+
10
+ c.attr :attempts, "int", :default => 3
11
+ c.attr :reconnect_timeout, "int", :default => 10
12
+ c.attr :restore_timeout, "int", :default => 5
13
+ end
14
+
@@ -1,10 +1,10 @@
1
- #if !defined( IMPL__CONN_PARAMS_HPP )
2
- #define IMPL_CONN_PARAMS_HPP
3
-
4
- namespace impl
5
- {
6
- #include "conn_params.impl.hpp"
7
- }
8
-
9
- #endif
10
-
1
+ #if !defined( IMPL__CONN_PARAMS_HPP )
2
+ #define IMPL_CONN_PARAMS_HPP
3
+
4
+ namespace impl
5
+ {
6
+ #include "conn_params.impl.hpp"
7
+ }
8
+
9
+ #endif
10
+
@@ -1,16 +1,16 @@
1
- require 'mxx_ru/cpp'
2
- require 'mxx_ru/cpp/rucodegen'
3
-
4
- Mxx_ru::Cpp::exe_target {
5
- target "host_config"
6
-
7
- rucodegen = generator Mxx_ru::Cpp::RuCodeGen.new( self )
8
-
9
- cpp_source "host_config.cpp"
10
- rucodegen << "host_config.rb"
11
-
12
- sources_root( "impl" ) {
13
- cpp_source "conn_params.cpp"
14
- rucodegen.add "conn_params.rb"
15
- }
16
- }
1
+ require 'mxx_ru/cpp'
2
+ require 'mxx_ru/cpp/rucodegen'
3
+
4
+ Mxx_ru::Cpp::exe_target {
5
+ target "host_config"
6
+
7
+ rucodegen = generator Mxx_ru::Cpp::RuCodeGen.new( self )
8
+
9
+ cpp_source "host_config.cpp"
10
+ rucodegen << "host_config.rb"
11
+
12
+ sources_root( "impl" ) {
13
+ cpp_source "conn_params.cpp"
14
+ rucodegen.add "conn_params.rb"
15
+ }
16
+ }
@@ -1,18 +1,18 @@
1
- require 'test/unit'
2
-
3
- require File.dirname( __FILE__ ) + '/../../test_with_compilation'
4
-
5
- class TC_RuCodeGen < Test::Unit::TestCase
6
- include TestWithCompilation
7
-
8
- test_path 'tests/cpp/rucodegen'
9
-
10
- test_case :successful_compile_and_link do
11
- assert_nothing_raised {
12
- build( 'prj.rb' )
13
- clean( 'prj.rb' )
14
- }
15
- end
16
-
17
- end
18
-
1
+ require 'test/unit'
2
+
3
+ require File.dirname( __FILE__ ) + '/../../test_with_compilation'
4
+
5
+ class TC_RuCodeGen < Test::Unit::TestCase
6
+ include TestWithCompilation
7
+
8
+ test_path 'tests/cpp/rucodegen'
9
+
10
+ test_case :successful_compile_and_link do
11
+ assert_nothing_raised {
12
+ build( 'prj.rb' )
13
+ clean( 'prj.rb' )
14
+ }
15
+ end
16
+
17
+ end
18
+
@@ -1,8 +1,8 @@
1
- require 'mxx_ru/cpp'
2
-
3
- Mxx_ru::setup_target(
4
- Mxx_ru::Cpp::Composite_target.new( Mxx_ru::BUILD_ROOT ) {
5
-
6
- required_prj( "prj.ut.rb" )
7
- }
8
- )
1
+ require 'mxx_ru/cpp'
2
+
3
+ Mxx_ru::setup_target(
4
+ Mxx_ru::Cpp::Composite_target.new( Mxx_ru::BUILD_ROOT ) {
5
+
6
+ required_prj( "prj.ut.rb" )
7
+ }
8
+ )
@@ -1 +1 @@
1
- Hello, World!
1
+ Hello, World!
@@ -1,128 +1,128 @@
1
- Hello, World!
2
- Hello, World!
3
- Hello, World!
4
- Hello, World!
5
- Hello, World!
6
- Hello, World!
7
- Hello, World!
8
- Hello, World!
9
- Hello, World!
10
- Hello, World!
11
- Hello, World!
12
- Hello, World!
13
- Hello, World!
14
- Hello, World!
15
- Hello, World!
16
- Hello, World!
17
- Hello, World!
18
- Hello, World!
19
- Hello, World!
20
- Hello, World!
21
- Hello, World!
22
- Hello, World!
23
- Hello, World!
24
- Hello, World!
25
- Hello, World!
26
- Hello, World!
27
- Hello, World!
28
- Hello, World!
29
- Hello, World!
30
- Hello, World!
31
- Hello, World!
32
- Hello, World!
33
- Hello, World!
34
- Hello, World!
35
- Hello, World!
36
- Hello, World!
37
- Hello, World!
38
- Hello, World!
39
- Hello, World!
40
- Hello, World!
41
- Hello, World!
42
- Hello, World!
43
- Hello, World!
44
- Hello, World!
45
- Hello, World!
46
- Hello, World!
47
- Hello, World!
48
- Hello, World!
49
- Hello, World!
50
- Hello, World!
51
- Hello, World!
52
- Hello, World!
53
- Hello, World!
54
- Hello, World!
55
- Hello, World!
56
- Hello, World!
57
- Hello, World!
58
- Hello, World!
59
- Hello, World!
60
- Hello, World!
61
- Hello, World!
62
- Hello, World!
63
- Hello, World!
64
- Hello, World!
65
- Hello, World!
66
- Hello, World!
67
- Hello, World!
68
- Hello, World!
69
- Hello, World!
70
- Hello, World!
71
- Hello, World!
72
- Hello, World!
73
- Hello, World!
74
- Hello, World!
75
- Hello, World!
76
- Hello, World!
77
- Hello, World!
78
- Hello, World!
79
- Hello, World!
80
- Hello, World!
81
- Hello, World!
82
- Hello, World!
83
- Hello, World!
84
- Hello, World!
85
- Hello, World!
86
- Hello, World!
87
- Hello, World!
88
- Hello, World!
89
- Hello, World!
90
- Hello, World!
91
- Hello, World!
92
- Hello, World!
93
- Hello, World!
94
- Hello, World!
95
- Hello, World!
96
- Hello, World!
97
- Hello, World!
98
- Hello, World!
99
- Hello, World!
100
- Hello, World!
101
- Hello, World!
102
- Hello, World!
103
- Hello, World!
104
- Hello, World!
105
- Hello, World!
106
- Hello, World!
107
- Hello, World!
108
- Hello, World!
109
- Hello, World!
110
- Hello, World!
111
- Hello, World!
112
- Hello, World!
113
- Hello, World!
114
- Hello, World!
115
- Hello, World!
116
- Hello, World!
117
- Hello, World!
118
- Hello, World!
119
- Hello, World!
120
- Hello, World!
121
- Hello, World!
122
- Hello, World!
123
- Hello, World!
124
- Hello, World!
125
- Hello, World!
126
- Hello, World!
127
- Hello, World!
128
- Hello, World!
1
+ Hello, World!
2
+ Hello, World!
3
+ Hello, World!
4
+ Hello, World!
5
+ Hello, World!
6
+ Hello, World!
7
+ Hello, World!
8
+ Hello, World!
9
+ Hello, World!
10
+ Hello, World!
11
+ Hello, World!
12
+ Hello, World!
13
+ Hello, World!
14
+ Hello, World!
15
+ Hello, World!
16
+ Hello, World!
17
+ Hello, World!
18
+ Hello, World!
19
+ Hello, World!
20
+ Hello, World!
21
+ Hello, World!
22
+ Hello, World!
23
+ Hello, World!
24
+ Hello, World!
25
+ Hello, World!
26
+ Hello, World!
27
+ Hello, World!
28
+ Hello, World!
29
+ Hello, World!
30
+ Hello, World!
31
+ Hello, World!
32
+ Hello, World!
33
+ Hello, World!
34
+ Hello, World!
35
+ Hello, World!
36
+ Hello, World!
37
+ Hello, World!
38
+ Hello, World!
39
+ Hello, World!
40
+ Hello, World!
41
+ Hello, World!
42
+ Hello, World!
43
+ Hello, World!
44
+ Hello, World!
45
+ Hello, World!
46
+ Hello, World!
47
+ Hello, World!
48
+ Hello, World!
49
+ Hello, World!
50
+ Hello, World!
51
+ Hello, World!
52
+ Hello, World!
53
+ Hello, World!
54
+ Hello, World!
55
+ Hello, World!
56
+ Hello, World!
57
+ Hello, World!
58
+ Hello, World!
59
+ Hello, World!
60
+ Hello, World!
61
+ Hello, World!
62
+ Hello, World!
63
+ Hello, World!
64
+ Hello, World!
65
+ Hello, World!
66
+ Hello, World!
67
+ Hello, World!
68
+ Hello, World!
69
+ Hello, World!
70
+ Hello, World!
71
+ Hello, World!
72
+ Hello, World!
73
+ Hello, World!
74
+ Hello, World!
75
+ Hello, World!
76
+ Hello, World!
77
+ Hello, World!
78
+ Hello, World!
79
+ Hello, World!
80
+ Hello, World!
81
+ Hello, World!
82
+ Hello, World!
83
+ Hello, World!
84
+ Hello, World!
85
+ Hello, World!
86
+ Hello, World!
87
+ Hello, World!
88
+ Hello, World!
89
+ Hello, World!
90
+ Hello, World!
91
+ Hello, World!
92
+ Hello, World!
93
+ Hello, World!
94
+ Hello, World!
95
+ Hello, World!
96
+ Hello, World!
97
+ Hello, World!
98
+ Hello, World!
99
+ Hello, World!
100
+ Hello, World!
101
+ Hello, World!
102
+ Hello, World!
103
+ Hello, World!
104
+ Hello, World!
105
+ Hello, World!
106
+ Hello, World!
107
+ Hello, World!
108
+ Hello, World!
109
+ Hello, World!
110
+ Hello, World!
111
+ Hello, World!
112
+ Hello, World!
113
+ Hello, World!
114
+ Hello, World!
115
+ Hello, World!
116
+ Hello, World!
117
+ Hello, World!
118
+ Hello, World!
119
+ Hello, World!
120
+ Hello, World!
121
+ Hello, World!
122
+ Hello, World!
123
+ Hello, World!
124
+ Hello, World!
125
+ Hello, World!
126
+ Hello, World!
127
+ Hello, World!
128
+ Hello, World!
@@ -1,89 +1,89 @@
1
- /*
2
- �������� ���������� ��� �������� Textfile_unittest_target.
3
-
4
- �������� � ��������� ������ ��� ���������:
5
- - ��� ��������������� �����;
6
- - ���������� �����, ������� ������ ���� �������� � ����.
7
-
8
- ������� ��������� �������������� ��������� ���� � ����������
9
- � ���� ��������� ���������� ����� "Hello, World!".
10
- */
11
-
12
- #include <iostream>
13
- #include <fstream>
14
- #include <sstream>
15
- #include <stdexcept>
16
-
17
- void
18
- show_usage()
19
- {
20
- std::cout << "test <out_file_name> <line_count>" << std::endl;
21
- }
22
-
23
- void
24
- parse_args(
25
- int argc, char ** argv,
26
- std::string & out_file_name,
27
- unsigned int & line_count )
28
- {
29
- if( 3 == argc )
30
- {
31
- out_file_name = argv[ 1 ];
32
-
33
- try
34
- {
35
- std::istringstream line_count_stream( argv[ 2 ] );
36
- line_count_stream.exceptions(
37
- std::ios::badbit | std::ios::failbit );
38
- line_count_stream >> line_count;
39
- }
40
- catch( const std::ios::failure & )
41
- {
42
- throw std::domain_error(
43
- "Unable to parse line_count argument: " +
44
- std::string( argv[ 2 ] ) );
45
- }
46
- }
47
- else
48
- {
49
- show_usage();
50
- throw std::runtime_error( "Invalid arguments" );
51
- }
52
- }
53
-
54
- void
55
- create_out_file(
56
- const std::string & file_name,
57
- unsigned int line_count )
58
- {
59
- std::ofstream to( file_name.c_str() );
60
- if( !to )
61
- throw std::runtime_error( "Unable to create file: " +
62
- file_name );
63
-
64
- while( line_count-- )
65
- to << "Hello, World!" << std::endl;
66
- }
67
-
68
- int
69
- main( int argc, char ** argv )
70
- {
71
- int rc = 1;
72
-
73
- try
74
- {
75
- std::string out_file_name;
76
- unsigned int line_count;
77
- parse_args( argc, argv, out_file_name, line_count );
78
-
79
- create_out_file( out_file_name, line_count );
80
-
81
- rc = 0;
82
- }
83
- catch( const std::exception & x )
84
- {
85
- std::cerr << "Oops! " << x.what() << std::endl;
86
- }
87
-
88
- return rc;
89
- }
1
+ /*
2
+ �������� ���������� ��� �������� Textfile_unittest_target.
3
+
4
+ �������� � ��������� ������ ��� ���������:
5
+ - ��� ��������������� �����;
6
+ - ���������� �����, ������� ������ ���� �������� � ����.
7
+
8
+ ������� ��������� �������������� ��������� ���� � ����������
9
+ � ���� ��������� ���������� ����� "Hello, World!".
10
+ */
11
+
12
+ #include <iostream>
13
+ #include <fstream>
14
+ #include <sstream>
15
+ #include <stdexcept>
16
+
17
+ void
18
+ show_usage()
19
+ {
20
+ std::cout << "test <out_file_name> <line_count>" << std::endl;
21
+ }
22
+
23
+ void
24
+ parse_args(
25
+ int argc, char ** argv,
26
+ std::string & out_file_name,
27
+ unsigned int & line_count )
28
+ {
29
+ if( 3 == argc )
30
+ {
31
+ out_file_name = argv[ 1 ];
32
+
33
+ try
34
+ {
35
+ std::istringstream line_count_stream( argv[ 2 ] );
36
+ line_count_stream.exceptions(
37
+ std::ios::badbit | std::ios::failbit );
38
+ line_count_stream >> line_count;
39
+ }
40
+ catch( const std::ios::failure & )
41
+ {
42
+ throw std::domain_error(
43
+ "Unable to parse line_count argument: " +
44
+ std::string( argv[ 2 ] ) );
45
+ }
46
+ }
47
+ else
48
+ {
49
+ show_usage();
50
+ throw std::runtime_error( "Invalid arguments" );
51
+ }
52
+ }
53
+
54
+ void
55
+ create_out_file(
56
+ const std::string & file_name,
57
+ unsigned int line_count )
58
+ {
59
+ std::ofstream to( file_name.c_str() );
60
+ if( !to )
61
+ throw std::runtime_error( "Unable to create file: " +
62
+ file_name );
63
+
64
+ while( line_count-- )
65
+ to << "Hello, World!" << std::endl;
66
+ }
67
+
68
+ int
69
+ main( int argc, char ** argv )
70
+ {
71
+ int rc = 1;
72
+
73
+ try
74
+ {
75
+ std::string out_file_name;
76
+ unsigned int line_count;
77
+ parse_args( argc, argv, out_file_name, line_count );
78
+
79
+ create_out_file( out_file_name, line_count );
80
+
81
+ rc = 0;
82
+ }
83
+ catch( const std::exception & x )
84
+ {
85
+ std::cerr << "Oops! " << x.what() << std::endl;
86
+ }
87
+
88
+ return rc;
89
+ }