ngdp_bpsv/
lib.rs

1//! # ngdp-bpsv
2//!
3//! A comprehensive parser and writer for BPSV (Blizzard Pipe-Separated Values) format,
4//! used throughout Blizzard's NGDP (Next Generation Distribution Pipeline) system.
5//!
6//! BPSV is a structured data format with typed columns, sequence numbers, and pipe-separated values.
7//!
8//! ## Format Structure
9//!
10//! ```text
11//! FieldName!TYPE:length|AnotherField!TYPE:length
12//! ## seqn = 12345
13//! value1|value2
14//! value3|value4
15//! ```
16//!
17//! ## Quick Start
18//!
19//! ### Parsing BPSV Data
20//!
21//! ```rust
22//! use ngdp_bpsv::BpsvDocument;
23//!
24//! let data = "Region!STRING:0|BuildId!DEC:4\n## seqn = 12345\nus|1234\neu|5678";
25//!
26//! let doc = BpsvDocument::parse(data)?;
27//! println!("Sequence: {:?}", doc.sequence_number());
28//! println!("Rows: {}", doc.rows().len());
29//! # Ok::<(), ngdp_bpsv::Error>(())
30//! ```
31//!
32//! ### Building BPSV Data
33//!
34//! ```rust
35//! use ngdp_bpsv::{BpsvBuilder, BpsvFieldType, BpsvValue};
36//!
37//! let mut builder = BpsvBuilder::new();
38//! builder.add_field("Region", BpsvFieldType::String(0))?;
39//! builder.add_field("BuildId", BpsvFieldType::Decimal(4))?;
40//! builder.set_sequence_number(12345);
41//!
42//! builder.add_row(vec![
43//!     BpsvValue::String("us".to_string()),
44//!     BpsvValue::Decimal(1234),
45//! ])?;
46//!
47//! let bpsv_output = builder.build()?;
48//! # Ok::<(), ngdp_bpsv::Error>(())
49//! ```
50
51pub mod builder;
52pub mod document;
53pub mod error;
54pub mod field_type;
55pub mod interned_document;
56pub mod interner;
57pub mod parser;
58pub mod schema;
59pub mod value;
60
61pub use builder::BpsvBuilder;
62pub use document::BpsvDocument;
63pub use error::{Error, Result};
64pub use field_type::BpsvFieldType;
65pub use interned_document::{InternedBpsvDocument, InternedRow};
66pub use interner::{InternedValue, StringInterner};
67pub use parser::BpsvParser;
68pub use schema::{BpsvField, BpsvSchema};
69pub use value::BpsvValue;