diff options
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/string')
4 files changed, 68 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/string/byte_string.rs b/crates/shirabe-external-packages/src/symfony/string/byte_string.rs new file mode 100644 index 0000000..58f4697 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/string/byte_string.rs @@ -0,0 +1,16 @@ +use crate::symfony::string::code_point_string::CodePointString; + +#[derive(Debug, Clone)] +pub struct ByteString { + pub(crate) string: String, +} + +impl ByteString { + pub fn new(_string: &str) -> Self { + todo!() + } + + pub fn to_code_point_string(&self, _encoding: &str) -> CodePointString { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/string/code_point_string.rs b/crates/shirabe-external-packages/src/symfony/string/code_point_string.rs new file mode 100644 index 0000000..3a1eee2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/string/code_point_string.rs @@ -0,0 +1,14 @@ +#[derive(Debug, Clone)] +pub struct CodePointString { + pub(crate) string: String, +} + +impl CodePointString { + pub fn wordwrap(&self, _width: i64, _break: &str, _cut: bool) -> Self { + todo!() + } + + pub fn to_byte_string(&self, _encoding: &str) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/string/mod.rs b/crates/shirabe-external-packages/src/symfony/string/mod.rs new file mode 100644 index 0000000..411a3f3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/string/mod.rs @@ -0,0 +1,16 @@ +pub mod byte_string; +pub mod code_point_string; +pub mod unicode_string; + +pub use byte_string::*; +pub use code_point_string::*; +pub use unicode_string::*; + +/// Mirror of Symfony's `u()` / `b()` helper functions. +pub fn b(_string: &str) -> ByteString { + todo!() +} + +pub fn s(_string: &str) -> UnicodeString { + todo!() +} diff --git a/crates/shirabe-external-packages/src/symfony/string/unicode_string.rs b/crates/shirabe-external-packages/src/symfony/string/unicode_string.rs new file mode 100644 index 0000000..18b1d49 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/string/unicode_string.rs @@ -0,0 +1,22 @@ +#[derive(Debug, Clone)] +pub struct UnicodeString { + pub(crate) string: String, +} + +impl UnicodeString { + pub fn new(_string: &str) -> Self { + todo!() + } + + pub fn width(&self, _ignore_unsupported_encoding: bool) -> i64 { + todo!() + } + + pub fn length(&self) -> i64 { + todo!() + } + + pub fn slice(&self, _start: i64, _length: Option<i64>) -> Self { + todo!() + } +} |
