diff options
author | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-23 05:37:45 +0000 |
---|---|---|
committer | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-23 05:37:45 +0000 |
commit | 343107b3de345a78307f9c07bff6ff1982f3a7ab (patch) | |
tree | 95be8e026e6ff5aaab2e4f237f3d425aa0b90545 /src/pugixml.cpp | |
parent | 046073830bfa338d7c7d07a3aa9f4262a9618d7d (diff) |
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
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index c085cef..01eeaaf 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -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); } |