Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Frazer <joseph.frazer@ryansg.com>2020-02-13 15:43:25 -0500
committerJoseph Frazer <joseph.frazer@ryansg.com>2020-03-03 11:21:18 -0500
commit6ac764108768e85db597c478ef7a754be416076b (patch)
tree1a71897b93da29feb2113896d60ce84b8e485796 /tamer/src/obj/xmle/writer/mod.rs
parentc2e6efc0b5c37e172485a2ec0adaafda4b6a4179 (diff)
downloadtame-6ac764108768e85db597c478ef7a754be416076b.tar.gz
tame-6ac764108768e85db597c478ef7a754be416076b.tar.bz2
tame-6ac764108768e85db597c478ef7a754be416076b.zip
[DEV-7083] TAMER: xmle writer
This introduces the writer for xmle files.
Diffstat (limited to 'tamer/src/obj/xmle/writer/mod.rs')
-rw-r--r--tamer/src/obj/xmle/writer/mod.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/tamer/src/obj/xmle/writer/mod.rs b/tamer/src/obj/xmle/writer/mod.rs
new file mode 100644
index 0000000..4287699
--- /dev/null
+++ b/tamer/src/obj/xmle/writer/mod.rs
@@ -0,0 +1,47 @@
+// Object file writer
+//
+// Copyright (C) 2014-2019 Ryan Specialty Group, LLC.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+//! xmle file writer.
+//!
+//! This defines a lower-level event-based `XmleWriter` similar to that of
+//! `quick_xml`, where the events are a slightly higher-level abstraction
+//! over the types of nodes present in the file.
+//!
+//! For more information on xmle files, see the [parent crate][`super`].
+//!
+//! The example below is incomplete, but shows the general usage.
+//!
+//! ```
+//! use tamer::obj::xmle::writer::{Sections, XmleWriter};
+//! use tamer::sym::{DefaultInterner, Interner, Symbol};
+//! use std::io::Cursor;
+//!
+//! let interner = DefaultInterner::new();
+//! let name = interner.intern(&String::from("foo"));
+//!
+//! let sections = Sections::new();
+//! let writer = Cursor::new(Vec::new());
+//! let mut xmle_writer = XmleWriter::new(writer);
+//! xmle_writer.write(&sections, name, &String::from(""));
+//! ```
+
+mod writer;
+mod xmle;
+
+pub use writer::{Result, Section, Sections, Writer, WriterError};
+
+pub use xmle::XmleWriter;