Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d2737dde
Commit
d2737dde
authored
May 14, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Implement GetProperty().
parent
305db0f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
6 deletions
+75
-6
reader.c
dlls/xmllite/reader.c
+3
-3
writer.c
dlls/xmllite/tests/writer.c
+23
-0
writer.c
dlls/xmllite/writer.c
+49
-3
No files found.
dlls/xmllite/reader.c
View file @
d2737dde
...
...
@@ -123,7 +123,7 @@ static const char *debugstr_nodetype(XmlNodeType nodetype)
return
type_names
[
nodetype
];
}
static
const
char
*
debugstr_prop
(
XmlReaderProperty
prop
)
static
const
char
*
debugstr_
reader_
prop
(
XmlReaderProperty
prop
)
{
static
const
char
*
const
prop_names
[]
=
{
...
...
@@ -2537,7 +2537,7 @@ static HRESULT WINAPI xmlreader_GetProperty(IXmlReader* iface, UINT property, LO
{
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_prop
(
property
),
value
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_
reader_
prop
(
property
),
value
);
if
(
!
value
)
return
E_INVALIDARG
;
...
...
@@ -2561,7 +2561,7 @@ static HRESULT WINAPI xmlreader_SetProperty(IXmlReader* iface, UINT property, LO
{
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
TRACE
(
"(%p)->(%s %lu)
\n
"
,
This
,
debugstr_prop
(
property
),
value
);
TRACE
(
"(%p)->(%s %lu)
\n
"
,
This
,
debugstr_
reader_
prop
(
property
),
value
);
switch
(
property
)
{
...
...
dlls/xmllite/tests/writer.c
View file @
d2737dde
...
...
@@ -71,6 +71,7 @@ static void test_writer_create(void)
{
HRESULT
hr
;
IXmlWriter
*
writer
;
LONG_PTR
value
;
/* crashes native */
if
(
0
)
...
...
@@ -81,6 +82,28 @@ static void test_writer_create(void)
hr
=
pCreateXmlWriter
(
&
IID_IXmlWriter
,
(
void
**
)
&
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* check default properties values */
value
=
0
;
hr
=
IXmlWriter_GetProperty
(
writer
,
XmlWriterProperty_ByteOrderMark
,
&
value
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
value
==
TRUE
,
"got %ld
\n
"
,
value
);
value
=
TRUE
;
hr
=
IXmlWriter_GetProperty
(
writer
,
XmlWriterProperty_Indent
,
&
value
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
value
==
FALSE
,
"got %ld
\n
"
,
value
);
value
=
TRUE
;
hr
=
IXmlWriter_GetProperty
(
writer
,
XmlWriterProperty_OmitXmlDeclaration
,
&
value
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
value
==
FALSE
,
"got %ld
\n
"
,
value
);
value
=
XmlConformanceLevel_Auto
;
hr
=
IXmlWriter_GetProperty
(
writer
,
XmlWriterProperty_ConformanceLevel
,
&
value
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
value
==
XmlConformanceLevel_Document
,
"got %ld
\n
"
,
value
);
IXmlWriter_Release
(
writer
);
}
...
...
dlls/xmllite/writer.c
View file @
d2737dde
...
...
@@ -52,6 +52,10 @@ typedef struct _xmlwriter
LONG
ref
;
IMalloc
*
imalloc
;
xmlwriteroutput
*
output
;
BOOL
indent
;
BOOL
bom
;
BOOL
omitxmldecl
;
XmlConformanceLevel
conformance
;
}
xmlwriter
;
static
inline
xmlwriter
*
impl_from_IXmlWriter
(
IXmlWriter
*
iface
)
...
...
@@ -64,6 +68,23 @@ static inline xmlwriteroutput *impl_from_IXmlWriterOutput(IXmlWriterOutput *ifac
return
CONTAINING_RECORD
(
iface
,
xmlwriteroutput
,
IXmlWriterOutput_iface
);
}
static
const
char
*
debugstr_writer_prop
(
XmlWriterProperty
prop
)
{
static
const
char
*
const
prop_names
[]
=
{
"MultiLanguage"
,
"Indent"
,
"ByteOrderMark"
,
"OmitXmlDeclaration"
,
"ConformanceLevel"
};
if
(
prop
>
_XmlWriterProperty_Last
)
return
wine_dbg_sprintf
(
"unknown property=%d"
,
prop
);
return
prop_names
[
prop
];
}
/* writer output memory allocation functions */
static
inline
void
*
writeroutput_alloc
(
xmlwriteroutput
*
output
,
size_t
len
)
{
...
...
@@ -191,13 +212,34 @@ static HRESULT WINAPI xmlwriter_SetOutput(IXmlWriter *iface, IUnknown *output)
return
writeroutput_query_for_stream
(
This
->
output
);
}
static
HRESULT
WINAPI
xmlwriter_GetProperty
(
IXmlWriter
*
iface
,
UINT
nProperty
,
LONG_PTR
*
ppV
alue
)
static
HRESULT
WINAPI
xmlwriter_GetProperty
(
IXmlWriter
*
iface
,
UINT
property
,
LONG_PTR
*
v
alue
)
{
xmlwriter
*
This
=
impl_from_IXmlWriter
(
iface
);
FIXME
(
"%p %u %p
\n
"
,
This
,
nProperty
,
ppV
alue
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_writer_prop
(
property
),
v
alue
);
return
E_NOTIMPL
;
if
(
!
value
)
return
E_INVALIDARG
;
switch
(
property
)
{
case
XmlWriterProperty_Indent
:
*
value
=
This
->
indent
;
break
;
case
XmlWriterProperty_ByteOrderMark
:
*
value
=
This
->
bom
;
break
;
case
XmlWriterProperty_OmitXmlDeclaration
:
*
value
=
This
->
omitxmldecl
;
break
;
case
XmlWriterProperty_ConformanceLevel
:
*
value
=
This
->
conformance
;
break
;
default:
FIXME
(
"Unimplemented property (%u)
\n
"
,
property
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
xmlwriter_SetProperty
(
IXmlWriter
*
iface
,
UINT
nProperty
,
LONG_PTR
pValue
)
...
...
@@ -567,6 +609,10 @@ HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
writer
->
imalloc
=
imalloc
;
if
(
imalloc
)
IMalloc_AddRef
(
imalloc
);
writer
->
output
=
NULL
;
writer
->
indent
=
FALSE
;
writer
->
bom
=
TRUE
;
writer
->
omitxmldecl
=
FALSE
;
writer
->
conformance
=
XmlConformanceLevel_Document
;
*
obj
=
&
writer
->
IXmlWriter_iface
;
...
...
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