1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! A library to read and write ID3v2 tags. ID3 versions v2.2, v2.3, and v2.4 are supported.
//! 
//! # Modifying an existing tag
//!
//! ```no_run
//! use id3::Tag;
//!
//! let mut tag= Tag::read_from_path("music.mp3").unwrap();
//!
//! // print the artist the hard way
//! println!("{}", tag.get("TALB").unwrap().content.text());
//! 
//! // or print it the easy way
//! println!("{}", tag.artist().unwrap());
//!
//! tag.save().unwrap();
//! ```
//!
//! # Creating a new tag
//!
//! ```no_run
//! use id3::{Tag, Frame};
//! use id3::frame::{Content, Encoding};
//!
//! let mut tag = Tag::with_version(4);
//! 
//! // set the album the hard way
//! let mut frame = Frame::new("TALB");
//! frame.encoding = Encoding::UTF8;
//! frame.content = Content::Text("album".to_owned());
//! tag.push(frame);
//!
//! // or set it the easy way
//! tag.set_album("album");
//!
//! tag.write_to_path("music.mp3").unwrap();
//! ```

#![crate_name = "id3"]
#![crate_type = "rlib"]
#![warn(missing_docs)]

#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;

pub use tag::Tag;
pub use frame::Frame;
pub use frame::Timestamp;
pub use error::{Result, Error, ErrorKind};

/// Utilities used for reading/writing ID3 tags.
pub mod util;

/// Contains types and methods for operating on ID3 frames.
pub mod frame;

mod error;
mod id3v1;
mod tag;
mod parsers;