DCL 3.7.4
Loading...
Searching...
No Matches
main.cpp File Reference
#include <dcl/Config.h>
#include <locale.h>
#include <wchar.h>
#include <dcl/Charset.h>
#include <dcl/FileWriter.h>
#include <dcl/Files.h>
#include "DocSyntax.h"
#include "DocParser.h"
#include "HtmlGenerator.h"

Go to the source code of this file.

Functions

__DCL_USING_NAMESPACE int __main (int argc, char *argv[])
int main (int argc, char *argv[])

Function Documentation

◆ __main()

__DCL_USING_NAMESPACE int __main ( int argc,
char * argv[] )

Definition at line 21 of file hse/HSAIDoc/main.cpp.

22{
25
26 if (argc < 3) {
27 err << L"Usage: idoc filename idoc.ini" << endl
28 << L"HSAIDocCmd.exe D:/Work/sdn/dcl/hse/HSAIDoc/main.cpp D:/Work/sdn/dcl/hse/HSAIDoc/src2html.ini"
29 << endl;
30 return 0;
31 }
32
33 String filename = LocaleDecoder::decode(argv[1]);
34 String iniFilename = LocaleDecoder::decode(argv[2]);
35
36 if (!Files::exists(filename)) {
37 err << L"Source file is not found! - " << filename << endl;
38 return 0;
39 }
40
41 if (!Files::exists(iniFilename)) {
42 err << L"Ini file is not found! - " << iniFilename << endl;
43 return 0;
44 }
45
46 try {
47 HtmlGenerator gen(iniFilename);
48
49 gen.generateHeader(out, filename);
50 gen.generate(out, filename);
51 gen.generateFooter(out);
52
53 }
54 catch (Exception* e) {
55 err << e->toStringAll();
56 e->destroy();
57 }
58
59 return 0;
60}
#define STDOUT_HANDLE
Definition File.h:59
#define STDERR_HANDLE
Definition File.h:60
DCLCVAR const struct __endl endl
virtual void destroy()
Definition Exception.cpp:74
String toStringAll() const
Definition Exception.cpp:45
static bool exists(const String &_path)
Definition Files.cpp:109

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 62 of file hse/HSAIDoc/main.cpp.

63{
64 int r = 0;
65 // std::locale::global(std::locale(""));
66 setlocale(LC_ALL, "");
67
69 try {
70#ifdef __DCL_DEBUG
71 FileWriter debugOut(STDERR_HANDLE);
72 DCLDebugSetGlobalReport(&debugOut);
73 try {
74#endif
75
76 r = __main(argc, argv);
77
78#ifdef __DCL_DEBUG
79 }
80 catch (Exception* cause) {
81 debugOut << cause->toStringAll() << endl;
82 cause->destroy();
83 }
84#if __DCL_HAVE_ALLOC_DEBUG
85 DCLDebugDumpGlobalMemoryLeak(DCL_ALLOC_DUMP_ALL, &debugOut);
86#endif
87 DCLDebugSetGlobalReport(NULL);
88#endif // __DCL_DEBUG
89 }
90 catch (Exception* e) {
91 String s = e->toStringAll();
92 e->destroy();
93 wprintf(L"Exception: %ls\n", s.data());
94 }
96
97 return r;
98}
#define NULL
Definition Config.h:312
IOException *size_t r
Definition MediaInfo.cpp:82
#define __DCL_CLEANUP
Definition Object.h:286
#define __DCL_INITIALIZE
Definition Object.h:285
__DCL_USING_NAMESPACE int __main(int argc, char *argv[])