Added format_save_file_text flag for opening the file in text mode
git-svn-id: http://pugixml.googlecode.com/svn/trunk@883 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
046073830b
commit
343107b3de
2 changed files with 5 additions and 2 deletions
|
@ -5256,13 +5256,13 @@ namespace pugi
|
|||
|
||||
PUGI__FN bool xml_document::save_file(const char* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const
|
||||
{
|
||||
FILE* file = fopen(path_, "wb");
|
||||
FILE* file = fopen(path_, (flags & format_save_file_text) ? "w" : "wb");
|
||||
return impl::save_file_impl(*this, file, indent, flags, encoding);
|
||||
}
|
||||
|
||||
PUGI__FN bool xml_document::save_file(const wchar_t* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const
|
||||
{
|
||||
FILE* file = impl::open_file_wide(path_, L"wb");
|
||||
FILE* file = impl::open_file_wide(path_, (flags & format_save_file_text) ? L"w" : L"wb");
|
||||
return impl::save_file_impl(*this, file, indent, flags, encoding);
|
||||
}
|
||||
|
||||
|
|
|
@ -184,6 +184,9 @@ namespace pugi
|
|||
// Don't escape attribute values and PCDATA contents. This flag is off by default.
|
||||
const unsigned int format_no_escapes = 0x10;
|
||||
|
||||
// Open file using text mode in xml_document::save_file. This enables special character (i.e. new-line) conversions on some systems. This flag is off by default.
|
||||
const unsigned int format_save_file_text = 0x20;
|
||||
|
||||
// The default set of formatting flags.
|
||||
// Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none.
|
||||
const unsigned int format_default = format_indent;
|
||||
|
|
Loading…
Add table
Reference in a new issue