Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
74a03dfd
Commit
74a03dfd
authored
Jun 01, 2010
by
Martin Lucina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:sustrik/zeromq2
parents
99e6179e
8a771350
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
7 deletions
+32
-7
AUTHORS
AUTHORS
+1
-1
xmlParser.cpp
foreign/xmlParser/xmlParser.cpp
+31
-6
No files found.
AUTHORS
View file @
74a03dfd
...
...
@@ -24,6 +24,7 @@ Matus Hamorsky <mhamorsky@gmail.com>
McClain Looney <m@loonsoft.com>
Pavel Gushcha <pavimus@gmail.com>
Pavol Malosek <malosek@fastmq.com>
Pieter Hintjens <ph@imatix.com>
Steven McCoy <steven.mccoy@miru.hk>
Tamara Kustarova <kustarova.tamara@gmail.com>
Tero Marttila <terom@fixme.fi>
...
...
@@ -53,6 +54,5 @@ Michael Santy <Michael.Santy@dynetics.com>
Paulo Henrique Silva <ph.silva@gmail.com>
Peter Busser <busserpeter@gmail.com>
Peter Lemenkov <lemenkov@gmail.com>
Pieter Hintjens <ph@imatix.com>
Robert Zhang <robert@scout-trading.com>
Toralf Wittner <toralf.wittner@gmail.com>
foreign/xmlParser/xmlParser.cpp
View file @
74a03dfd
...
...
@@ -421,7 +421,7 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag)
// create message
char
message
[
2000
],
*
s1
=
(
char
*
)
""
,
*
s3
=
(
char
*
)
""
;
XMLCSTR
s2
=
_CXML
(
""
);
if
(
pResults
.
error
==
eXMLErrorFirstTagNotFound
)
{
s1
=
(
char
*
)
"First Tag should be '"
;
s2
=
tag
;
s3
=
(
char
*
)
"'.
\n
"
;
}
s
printf
(
message
,
s
nprintf
(
message
,
2000
,
#ifdef _XMLWIDECHAR
"XML Parsing error inside file '%S'.
\n
%S
\n
At line %i, column %i.
\n
%s%S%s"
#else
...
...
@@ -608,11 +608,18 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
if
(
!
f
)
return
eXMLErrorCannotOpenWriteFile
;
#ifdef _XMLWIDECHAR
unsigned
char
h
[
2
]
=
{
0xFF
,
0xFE
};
if
(
!
fwrite
(
h
,
2
,
1
,
f
))
return
eXMLErrorCannotWriteFile
;
if
(
!
fwrite
(
h
,
2
,
1
,
f
))
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
if
((
!
isDeclaration
())
&&
((
d
->
lpszName
)
||
(
!
getChildNode
().
isDeclaration
())))
{
if
(
!
fwrite
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
utf-16
\"
?>
\n
"
,
sizeof
(
wchar_t
)
*
40
,
1
,
f
))
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
}
#else
if
((
!
isDeclaration
())
&&
((
d
->
lpszName
)
||
(
!
getChildNode
().
isDeclaration
())))
...
...
@@ -620,23 +627,41 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm
if
(
characterEncoding
==
char_encoding_UTF8
)
{
// header so that windows recognize the file as UTF-8:
unsigned
char
h
[
3
]
=
{
0xEF
,
0xBB
,
0xBF
};
if
(
!
fwrite
(
h
,
3
,
1
,
f
))
return
eXMLErrorCannotWriteFile
;
unsigned
char
h
[
3
]
=
{
0xEF
,
0xBB
,
0xBF
};
if
(
!
fwrite
(
h
,
3
,
1
,
f
))
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
encoding
=
"utf-8"
;
}
else
if
(
characterEncoding
==
char_encoding_ShiftJIS
)
encoding
=
"SHIFT-JIS"
;
if
(
!
encoding
)
encoding
=
"ISO-8859-1"
;
if
(
fprintf
(
f
,
"<?xml version=
\"
1.0
\"
encoding=
\"
%s
\"
?>
\n
"
,
encoding
)
<
0
)
return
eXMLErrorCannotWriteFile
;
if
(
fprintf
(
f
,
"<?xml version=
\"
1.0
\"
encoding=
\"
%s
\"
?>
\n
"
,
encoding
)
<
0
)
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
}
else
{
if
(
characterEncoding
==
char_encoding_UTF8
)
{
unsigned
char
h
[
3
]
=
{
0xEF
,
0xBB
,
0xBF
};
if
(
!
fwrite
(
h
,
3
,
1
,
f
))
return
eXMLErrorCannotWriteFile
;
unsigned
char
h
[
3
]
=
{
0xEF
,
0xBB
,
0xBF
};
if
(
!
fwrite
(
h
,
3
,
1
,
f
))
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
}
}
#endif
int
i
;
XMLSTR
t
=
createXMLString
(
nFormat
,
&
i
);
if
(
!
fwrite
(
t
,
sizeof
(
XMLCHAR
)
*
i
,
1
,
f
))
return
eXMLErrorCannotWriteFile
;
if
(
!
fwrite
(
t
,
sizeof
(
XMLCHAR
)
*
i
,
1
,
f
))
{
fclose
(
f
);
return
eXMLErrorCannotWriteFile
;
}
if
(
fclose
(
f
)
!=
0
)
return
eXMLErrorCannotWriteFile
;
free
(
t
);
return
eXMLErrorNone
;
...
...
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