Skip to main content

lib_bcsv_jmap/
lib.rs

1//! # jmap
2//!
3//! A Rust library for reading and writing Nintendo's BCSV/JMap format
4//! This format is used by Super Mario Galaxy and some other games
5//!
6//! ## Quick Start
7//!
8//! ```rust,no_run
9//! use lib_bcsv_jmap::{from_file, to_csv, smg_hash_table_with_lookup, IoOptions};
10//!
11//! // Create a hash table with known field names
12//! let hash_table = smg_hash_table_with_lookup("hashtable_smg.txt").unwrap();
13//!
14//! // Read a BCSV file
15//! let jmap = from_file(hash_table, "scenariodata.bcsv", &IoOptions::default()).unwrap();
16//!
17//! // Print some data
18//! println!("Entries: {}", jmap.len());
19//! for entry in jmap.entries() {
20//!     if let Some(name) = entry.get_string(jmap.hash_table(), "ZoneName") {
21//!         println!("Zone: {}", name);
22//!     }
23//! }
24//!
25//! // Export to CSV
26//! to_csv(&jmap, "output.csv", None).unwrap();
27//! ```
28//!
29//! ## Features
30//!
31//! - Read and write BCSV files with full format support
32//! - big-endian and little-endian support
33//! - Shift-JIS and UTF-8 string encoding
34//! - CSV import/export
35
36pub mod csv;
37pub mod entry;
38pub mod error;
39pub mod field;
40pub mod hash;
41pub mod io;
42pub mod jmap;
43
44
45pub use crate::csv::{from_csv, to_csv};
46pub use crate::entry::{Entry, FieldKey};
47pub use crate::error::{JMapError, Result};
48pub use crate::field::{Field, FieldType, FieldValue};
49pub use crate::hash::{
50    calc_hash, FileHashTable, HashAlgorithm, HashTable,
51    smg_hash_table, smg_hash_table_with_lookup,
52};
53pub use crate::io::{from_buffer, from_file, to_buffer, to_file, Encoding, IoOptions};
54pub use crate::jmap::JMapInfo;