format::DisplayPlain,
output::{
Item, Text,
- pivot::{Axis3, Dimension, Group, PivotTable, Value},
+ pivot::{Axis3, Dimension, Group, PivotTable, value::Value},
},
variable::{VarType, VarWidth},
};
data::{ByteString, Datum, RawString},
identifier::{ByIdentifier, HasIdentifier, Identifier},
output::pivot::{
- Axis3, Dimension, Display26Adic, Footnote, Footnotes, Group, PivotTable, Value,
+ Axis3, Dimension, Display26Adic, Footnote, Footnotes, Group, PivotTable, value::Value,
},
settings::Show,
variable::{Attributes, VarWidth, Variable},
output::pivot::{
Axis3, Dimension, Group,
look::{BorderStyle, Look},
+ value::Value,
},
};
-use self::pivot::Value;
-
pub mod drivers;
pub mod page;
pub mod pivot;
use smallvec::SmallVec;
use crate::{
- format::{Format, Settings as FormatSettings, F40, F40_2, F40_3, PCT40_1},
- output::pivot::{look::{Look, Sizing}, value::{
- BareValue, DisplayValue, IntoValueOptions, NumberValue, ValueInner, ValueOptions,
- }},
+ format::{F40, F40_2, F40_3, Format, PCT40_1, Settings as FormatSettings},
+ output::pivot::{
+ look::{Look, Sizing},
+ value::{
+ BareValue, DisplayValue, IntoValueOptions, NumberValue, Value, ValueInner, ValueOptions,
+ },
+ },
settings::{Settings, Show},
variable::Variable,
};
mod output;
pub use output::OutputTables;
mod look_xml;
-pub mod value;
-pub use value::Value;
mod tlo;
+pub mod value;
#[cfg(test)]
pub mod tests;
}
}
-/// Dimensions.
+/// A dimension.
///
/// A [Dimension] identifies the categories associated with a single dimension
/// within a multidimensional pivot table.
use std::str::FromStr;
use crate::output::pivot::{
- Display26Adic, MetadataEntry, MetadataValue, Value,
+ Display26Adic, MetadataEntry, MetadataValue,
look::Color,
tests::assert_rendering,
- value::{TemplateValue, ValueInner},
+ value::{TemplateValue, Value, ValueInner},
};
#[test]
};
use crate::output::pivot::{
- Axis2, Axis3, Dimension, PivotTable, Value,
+ Axis2, Axis3, Dimension, PivotTable,
look::{Area, Border, BorderStyle, BoxBorder, Color, RowColBorder, Stroke},
- value::IntoValueOptions,
+ value::{IntoValueOptions, Value},
};
/// All of the combinations of dimensions along an axis.
},
};
-use super::{Axis3, Value};
+use super::{Axis3, value::Value};
#[test]
fn color() {
use crate::{
output::pivot::{
- Axis2, Footnote, Value,
+ Axis2, Footnote,
look::{
Area, AreaStyle, Border, BorderStyle, CellStyle, FontStyle, HeadingRegion, HorzAlign,
},
- value::{DisplayValue, ValueInner, ValueOptions},
+ value::{DisplayValue, Value, ValueInner, ValueOptions},
},
spv::html,
};
dictionary::Dictionary,
format::{Error as FormatError, Format, UncheckedFormat},
identifier::{Error as IdError, Identifier},
- output::pivot::{MetadataEntry, MetadataValue, PivotTable, Value},
+ output::pivot::{MetadataEntry, MetadataValue, PivotTable, value::Value},
sys::raw::{self, CaseDetails, CaseVar, CompressionAction, records::RawFormat},
variable::{MissingValues, MissingValuesError, VarWidth, Variable},
};
dictionary::{DictIndex, Dictionary},
format::{Error as FormatError, Format, Type, UncheckedFormat},
identifier::{Error as IdError, Identifier},
- output::pivot::{MetadataEntry, MetadataValue, PivotTable, Value},
+ output::pivot::{MetadataEntry, MetadataValue, PivotTable, value::Value},
por::portable_to_windows_1252,
variable::{MissingValueRange, MissingValues, MissingValuesError, VarType, VarWidth, Variable},
};
crypto::EncryptedFile,
output::{
Details, Item, SpvInfo, SpvMembers, Text, page,
- pivot::{Axis2, Length, TableProperties, Value, look::Look},
+ pivot::{Axis2, Length, TableProperties, look::Look, value::Value},
},
spv::read::{
html::Document,
use serde::{Deserialize, Deserializer, Serialize, ser::SerializeMap};
use crate::output::pivot::{
- Value,
look::{CellStyle, Color, FontStyle, HorzAlign},
+ value::Value,
};
fn lowercase<'a>(s: &'a str) -> Cow<'a, str> {
calendar::{date_time_to_pspp, time_to_pspp},
data::Datum,
format::{Category, Format},
- output::pivot::Value,
+ output::pivot::value::Value,
spv::read::light::{U32String, decode_format, parse_vec},
};
format::{self, Decimal::Dot, F8_0, F40_2, Type, UncheckedFormat},
output::pivot::{
self, Axis2, Axis3, Category, CategoryLocator, Dimension, Group, Leaf, Length, PivotTable,
- Value,
look::{
self, Area, AreaStyle, CellStyle, Color, HeadingRegion, HorzAlign, Look, RowParity,
VertAlign,
},
- value::{NumberValue, ValueInner},
+ value::{NumberValue, Value, ValueInner},
},
spv::read::legacy_bin::DataValue,
};
RowColBorder, RowParity, Stroke, VertAlign,
},
parse_bool,
- value::{StringValue, TemplateValue, ValueStyle, VariableValue},
+ value::{self, StringValue, TemplateValue, ValueStyle, VariableValue},
},
settings::Show,
};
}
impl ValueNumber {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format)
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format)
.with_styling(ValueMods::decode_optional(&self.mods, encoding, footnotes))
}
}
impl ValueVarNumber {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format)
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format)
.with_styling(ValueMods::decode_optional(&self.mods, encoding, footnotes))
.with_value_label(self.value_label.decode_optional(encoding))
.with_variable_name(Some(self.var_name.decode(encoding)))
}
impl ValueText {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new_general_text(
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new_general_text(
self.local.decode(encoding),
self.c.decode(encoding),
self.id.decode(encoding),
}
impl ValueString {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new(pivot::value::ValueInner::String(StringValue {
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new(pivot::value::ValueInner::String(StringValue {
s: self.s.decode(encoding),
hex: self.format.type_() == Type::AHex,
show: self.show,
}
impl ValueVarName {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new(pivot::value::ValueInner::Variable(VariableValue {
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new(pivot::value::ValueInner::Variable(VariableValue {
show: self.show,
var_name: self.var_name.decode(encoding),
variable_label: self.var_label.decode_optional(encoding),
}
}
impl ValueFixedText {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new_general_text(
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new_general_text(
self.local.decode(encoding),
self.c.decode(encoding),
self.id.decode(encoding),
}
impl ValueTemplate {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
- pivot::Value::new(pivot::value::ValueInner::Template(TemplateValue {
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
+ value::Value::new(pivot::value::ValueInner::Template(TemplateValue {
args: self
.args
.iter()
}
impl Value {
- fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value {
+ fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value {
match self {
Value::Number(number) => number.decode(encoding, footnotes),
Value::VarNumber(var_number) => var_number.decode(encoding, footnotes),
&self,
encoding: &'static Encoding,
footnotes: &pivot::Footnotes,
- ) -> Vec<pivot::Value> {
+ ) -> Vec<value::Value> {
self.0
.iter()
.map(|value| value.decode(encoding, footnotes))
page::{ChartSize, PageSetup},
pivot::{
Axis2, Axis3, Category, Dimension, Footnote, FootnoteMarkerPosition,
- FootnoteMarkerType, Footnotes, Group, Leaf, PivotTable, Value,
+ FootnoteMarkerType, Footnotes, Group, Leaf, PivotTable,
look::{
Area, AreaStyle, Border, BorderStyle, BoxBorder, CellStyle, Color, FontStyle,
HeadingRegion, HorzAlign, LabelPosition, RowColBorder, RowParity, Stroke,
VertAlign,
},
- value::{ValueInner, ValueStyle},
+ value::{Value, ValueInner, ValueStyle},
},
},
settings::Show,
format::{Error as FormatError, Format, UncheckedFormat},
hexfloat::HexFloat,
identifier::{Error as IdError, Identifier},
- output::pivot::{Axis3, Dimension, Group, PivotTable, Value},
+ output::pivot::{Axis3, Dimension, Group, PivotTable, value::Value},
sys::{
raw::{
self, CaseDetails, DecodedRecord, RawCases, RawDatum, RawWidth, Reader, infer_encoding,
identifier::{Error as IdError, Identifier},
output::{
Details, Item, Text,
- pivot::{Axis3, Dimension, Group, PivotTable, Value},
+ pivot::{Axis3, Dimension, Group, PivotTable, value::Value},
},
sys::{
encoding::{Error as EncodingError, default_encoding, get_encoding},
identifier::Identifier,
output::{
Item, Text,
- pivot::{Axis3, Dimension, Group, PivotTable, Value, tests::assert_lines_eq},
+ pivot::{Axis3, Dimension, Group, PivotTable, tests::assert_lines_eq, value::Value},
},
sys::{
WriteOptions,