Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
52b23b98
Kaydet (Commit)
52b23b98
authored
Nis 24, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Print message of uncaught UNO exceptions
Change-Id: I6a716efe28086da983a40c550613e3d8e0bd8283
üst
f0c5abd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
35 deletions
+32
-35
saxparser.cxx
i18npool/source/localedata/saxparser.cxx
+32
-35
No files found.
i18npool/source/localedata/saxparser.cxx
Dosyayı görüntüle @
52b23b98
...
...
@@ -17,7 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sal/config.h"
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
...
...
@@ -296,52 +299,46 @@ public:
SAL_IMPLEMENT_MAIN_WITH_ARGS
(
argc
,
argv
)
{
try
{
if
(
argc
<
4
)
{
printf
(
"usage : %s <locaLe> <XML inputfile> <destination file>
\n
"
,
argv
[
0
]
);
exit
(
1
);
}
Reference
<
XComponentContext
>
xContext
(
defaultBootstrap_InitialComponentContext
());
if
(
argc
<
4
)
{
printf
(
"usage : %s <locaLe> <XML inputfile> <destination file>
\n
"
,
argv
[
0
]
);
exit
(
1
);
}
Reference
<
XComponentContext
>
xContext
(
defaultBootstrap_InitialComponentContext
());
//--------------------------------
// parser demo
// read xml from a file and count elements
//--------------------------------
Reference
<
XParser
>
rParser
=
Parser
::
create
(
xContext
);
//--------------------------------
// parser demo
// read xml from a file and count elements
//--------------------------------
Reference
<
XParser
>
rParser
=
Parser
::
create
(
xContext
);
int
nError
=
0
;
// create and connect the document handler to the parser
TestDocumentHandler
*
pDocHandler
=
new
TestDocumentHandler
(
argv
[
1
],
argv
[
3
]);
int
nError
=
0
;
// create and connect the document handler to the parser
TestDocumentHandler
*
pDocHandler
=
new
TestDocumentHandler
(
argv
[
1
],
argv
[
3
]);
Reference
<
XDocumentHandler
>
rDocHandler
(
(
XDocumentHandler
*
)
pDocHandler
);
Reference
<
XEntityResolver
>
rEntityResolver
(
(
XEntityResolver
*
)
pDocHandler
);
Reference
<
XDocumentHandler
>
rDocHandler
(
(
XDocumentHandler
*
)
pDocHandler
);
Reference
<
XEntityResolver
>
rEntityResolver
(
(
XEntityResolver
*
)
pDocHandler
);
rParser
->
setDocumentHandler
(
rDocHandler
);
rParser
->
setEntityResolver
(
rEntityResolver
);
rParser
->
setDocumentHandler
(
rDocHandler
);
rParser
->
setEntityResolver
(
rEntityResolver
);
// create the input stream
InputSource
source
;
source
.
aInputStream
=
createStreamFromFile
(
argv
[
2
]
);
source
.
sSystemId
=
OUString
::
createFromAscii
(
argv
[
2
]
);
// create the input stream
InputSource
source
;
source
.
aInputStream
=
createStreamFromFile
(
argv
[
2
]
);
source
.
sSystemId
=
OUString
::
createFromAscii
(
argv
[
2
]
);
try
{
// start parsing
rParser
->
parseStream
(
source
);
}
catch
(
const
Exception
&
e
)
{
OString
o1
=
OUStringToOString
(
e
.
Message
,
RTL_TEXTENCODING_UTF8
);
printf
(
"Exception during parsing : %s
\n
"
,
o1
.
getStr
()
);
exit
(
1
);
}
nError
=
pDocHandler
->
nError
;
nError
=
pDocHandler
->
nError
;
return
nError
;
return
nError
;
}
catch
(
css
::
uno
::
Exception
&
e
)
{
std
::
cerr
<<
"ERROR: "
<<
e
.
Message
<<
'\n'
;
return
EXIT_FAILURE
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment