Commit Graph

1415 Commits

Author SHA1 Message Date
Stephan Beyer
6bbbdb7d7e Make cxxstd an argument to Makefile
This determines the used C++ standard.
If you do not want to use a specific C++ standard, use cxxstd=any.
The default is set to c++11.

The "define" PUGIXML_NO_CXX11 is removed from the Makefile
since it is not used in the code anyways.
2016-01-26 22:14:58 +01:00
Stephan Beyer
fb647f69a2 Let Travis CI use Ubuntu trusty
This allows to perform C++11-based tests on the Linux.
2016-01-26 21:53:16 +01:00
Stephan Beyer
fc9073289f test_parse.cpp: add newline to last line
This is necessary in order to comply with the C++03 standard.
2016-01-24 19:47:06 +01:00
Arseny Kapoulkine
e133764f33 Merge pull request #81 from ogdf/whitespace-issues
Fix whitespace issues
2016-01-24 08:56:06 -08:00
Stephan Beyer
f7aa65db8a Fix whitespace issues
Git warns when it finds "whitespace errors". This commit gets
rid of these whitespace errors for code and adoc files.
2016-01-24 14:05:44 +01:00
Arseny Kapoulkine
7f91301946 Change header format in non-compact mode to store page offset
This utilizes the fact that pages are of limited size so we can store offset
from the object to the page in a few bits - we currently use 24 although that's
excessive given that pages are limited to ~512k.

This has several benefits:

- Pages do not have to be 64b aligned any more - this simplifies allocation flow
and frees up 40-50 bytes from xml_document::_memory.

- Header now has 8 bits available for metadata for both compact and default mode
which makes it possible to store type as-is (allowing easy type extension and
removing one add/sub operation from type checks).

- One extra bit is easily available for future metadata extension (in addition
to the bit for type encoding that could be reclaimed if necessary).

- Allocators that return 4b-aligned memory on 64-bit platforms work fine if
misaligned reads are supported.

The downside is that there is one or two extra instructions on the allocation
path. This does not seem to hurt parsing performance.
2016-01-20 21:51:02 -08:00
Arseny Kapoulkine
7aef75f43d docs: Adjust as_int documentation to match implementation
Also remove the description of behavior for trailing non-numeric characters.
It's likely this will become a parse error in the future so better leave it
as unspecified for now.

Fixes #80.
2016-01-19 21:17:08 -08:00
Arseny Kapoulkine
c388dbeba4 Merge pull request #79 from zeux/embed-pcdata
Add parse_embed_pcdata flag

This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of the document; this flag is only recommended for parsing documents with a lot of PCDATA nodes in a very memory-constrained environment.

Most high-level APIs continue to work; code that inspects DOM using first_child()/value() will have to be adapted.
2016-01-14 07:52:40 -08:00
Arseny Kapoulkine
4f3be76167 Preserve order semantics for child_value/text when using parse_embed_pcdata
The performance cost is probably negligible and this means we treat embedded
value as the first child consistently.
2016-01-12 20:41:37 -08:00
Arseny Kapoulkine
85238132d3 docs: Add parse_embed_pcdata documentation 2016-01-12 20:38:45 -08:00
Arseny Kapoulkine
71d3a797f4 Adjust parse_embed_pcdata documentation
Since round-tripping should not be a problem any more don't mention it.
2016-01-12 20:18:12 -08:00
Arseny Kapoulkine
fc6c8633dd tests: Add test for parse_embed_pcdata 2016-01-12 20:16:29 -08:00
Arseny Kapoulkine
bcddf36559 Only save first PCDATA contents in the element
This change fixes an important ordering issue - if element node has a PCDATA
child *after* other elements, it's impossible to tell which order the children
were in.

Since the goal of PCDATA embedding is to save memory when it's the only child,
only apply the optimization to the first child. This seems to fix all
roundtripping issues so the only caveat is that the DOM structure is different.
2016-01-12 20:01:44 -08:00
Arseny Kapoulkine
df2a0ad28b Implement output support for embedded PCDATA values
This is a bit awkward since preserving correct indentation structure requires
a bit of extra work, and the closing tag has to be written by _start function
to correctly process the rest of the tree.
2016-01-09 17:46:42 -08:00
Arseny Kapoulkine
85d8b225f2 Support XPath string value for parse_embed_pcdata 2016-01-08 08:41:38 -08:00
Arseny Kapoulkine
8b01f8923c Support xml_node::child_value/text for parse_embed_pcdata 2016-01-08 08:40:56 -08:00
Arseny Kapoulkine
2874f6f21d Add initial support for parse_embed_pcdata
When this flag is true, PCDATA value is saved to the parent element instead of
allocating a new node.

This prevents some documents from round-tripping since it loses information,
but can provide a significant memory reduction and parsing speedup for some
documents.
2016-01-08 08:37:26 -08:00
Arseny Kapoulkine
ad3b492c1a docs: Regenerate HTML documentation 2015-12-31 17:22:41 +03:00
Arseny Kapoulkine
5f58e9bd0c Update all license/copyright texts to 2016 2015-12-31 17:22:21 +03:00
Arseny Kapoulkine
af7177e77d docs: Use ISO-8601 for changelog dates 2015-12-31 17:11:54 +03:00
Arseny Kapoulkine
03b1b6a5c3 scripts: Fix default value for STATIC_CRT option
Also refactor to use the same case and run after common options.
2015-12-30 23:58:03 +03:00
Arseny Kapoulkine
6a22a28730 Merge pull request #70 from nirbar/master
scripts: Allow linking static CRT libraries on Windows

Use the solution from CMake FAQ to specify correct command-line arguments.
2015-12-30 23:54:58 +03:00
Arseny Kapoulkine
1bcf12402e Work around Clang Wstring-conversion warnings
(!"string") triggers the warning however (false && "string") does not.

Fixes #75.
2015-12-29 21:43:24 +03:00
nir.bar
3dadebf10e Merge branch 'master' of github.com:nirbar/pugixml 2015-12-03 13:19:52 +02:00
nir.bar
0d111976e1 Add CMake option on MSVC- STATIC_CRT 2015-12-03 12:33:44 +02:00
Arseny Kapoulkine
2cf599b310 Work around MinGW versions with non-C99 compliant headers
Apparently some MinGW distributions have a compiler that's recent enough to
support C++11 but limits.h header that incorrectly omits LLONG limits in
strict ANSI mode, since it guards the definitions with:

	#if !defined(__STRICT_ANSI__) && defined(__GNUC__)

We can just define these symbols ourselves in this specific case.

Fixes #66.
2015-11-13 09:09:43 -08:00
SeVlaT
d2bae889eb Added readme.txt 2015-11-13 17:18:44 +03:00
SeVlaT
588118feb7 Added msvc12 solution and projects: converted from Msvc10 2015-11-13 15:49:59 +03:00
SeVlaT
64fb7bb15a Added msvc11 solution and projects: converted from Msvc10 2015-11-13 15:49:37 +03:00
SeVlaT
ab1a1ef1d3 Updated Msvc10 solution 2015-11-13 15:20:22 +03:00
SeVlaT
8df08bfd3e Msvc14: IntDir and OutDir changed a little 2015-11-13 14:20:40 +03:00
SeVlaT
85f190d48f msvc14: import pugixml.s.props to static project 2015-11-13 14:12:08 +03:00
SeVlaT
e8b1349e83 Msvc14: Added Rtl_Type suffix to IntDir and OutDir 2015-11-13 14:11:40 +03:00
SeVlaT
3d8ae832ee added msvc2015_static.vcxproj (just by copying from msvc2015.vcxproj) 2015-11-13 14:05:58 +03:00
SeVlaT
286c32e5d5 pugixml.props: support custom user property sheet 2015-11-13 14:02:18 +03:00
SeVlaT
05df29c9ab msvc14: Cosmetic changes, removed empty tags 2015-11-13 14:01:41 +03:00
SeVlaT
391725fb02 Msvc14: inherit Linker settings 2015-11-13 13:35:03 +03:00
SeVlaT
a40b7ef192 Msvc14: Moved <PreprocessorDefinitions> to Props 2015-11-13 13:27:52 +03:00
SeVlaT
fbfac6d123 Added platform-specific props for Msvc14 2015-11-13 13:24:38 +03:00
SeVlaT
9a81561d99 pugixmpprops: support Msvc vesion and platform specific props 2015-11-13 13:24:16 +03:00
SeVlaT
e067e8676c Msvc14: removed _DEBUG/NDEBUG, moved some <ClCompile> options to props 2015-11-13 13:19:26 +03:00
SeVlaT
03e46219db Msvc14: Inherit <PrecompiledHeader> 2015-11-13 13:09:57 +03:00
SeVlaT
dade2b81c1 Msvc14: Moved <OutDir>, <IntDir>, <TargetName>, <DebugInformationFormat> to props 2015-11-13 13:04:10 +03:00
SeVlaT
7bcd6c89bd Added Msvc14-specific props (yet empty) 2015-11-13 12:57:50 +03:00
SeVlaT
cdb8858446 pugixml.props: support props, specific for MSVC version 2015-11-13 12:53:54 +03:00
SeVlaT
ccbfc905bf Msvc15: removed some compiler options, that are well-inherited from Props 2015-11-13 12:38:02 +03:00
SeVlaT
a21e3524ec Msvc14: removed <ClCompile><ProgramDataBaseFileName>
Remark:
<ProgramDataBaseFileName> - compiler setting
<ProgramDataBaseFile> - linker setting
Both of them  probably set well by default.
2015-11-13 12:29:02 +03:00
SeVlaT
a4b7273ee1 Msvc14: <Import Project="pugixml.props" /> 2015-11-13 11:34:08 +03:00
SeVlaT
afb646cef4 Msvc14: added solution 2015-11-13 11:29:53 +03:00
SeVlaT
e0c2ee576c Msvc10: cosmetic changes. Remove unnecessary empty tags 2015-11-13 11:24:55 +03:00