blob: 414baf07bfa468343d1e8da612a04efb4e76440c (
plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/// Convert to camelCase format (brewCoffee)
///
/// # Examples
///
/// ```
/// # use string_proc::camel_case;
/// assert_eq!(camel_case!("brew_coffee"), "brewCoffee");
/// ```
#[macro_export]
macro_rules! camel_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_camel_case()
}};
}
/// Convert to UPPER CASE format (BREW COFFEE)
///
/// # Examples
///
/// ```
/// # use string_proc::upper_case;
/// assert_eq!(upper_case!("brew coffee"), "BREW COFFEE");
/// ```
#[macro_export]
macro_rules! upper_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_upper_case()
}};
}
/// Convert to lower case format (brew coffee)
///
/// # Examples
///
/// ```
/// # use string_proc::lower_case;
/// assert_eq!(lower_case!("BREW COFFEE"), "brew coffee");
/// ```
#[macro_export]
macro_rules! lower_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_lower_case()
}};
}
/// Convert to Title Case format (Brew Coffee)
///
/// # Examples
///
/// ```
/// # use string_proc::title_case;
/// assert_eq!(title_case!("brew_coffee"), "Brew Coffee");
/// ```
#[macro_export]
macro_rules! title_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_title_case()
}};
}
/// Convert to dot.case format (brew.coffee)
///
/// # Examples
///
/// ```
/// # use string_proc::dot_case;
/// assert_eq!(dot_case!("brew_coffee"), "brew.coffee");
/// ```
#[macro_export]
macro_rules! dot_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_dot_case()
}};
}
/// Convert to snake_case format (brew_coffee)
///
/// # Examples
///
/// ```
/// # use string_proc::snake_case;
/// assert_eq!(snake_case!("brewCoffee"), "brew_coffee");
/// ```
#[macro_export]
macro_rules! snake_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_snake_case()
}};
}
/// Convert to kebab-case format (brew-coffee)
///
/// # Examples
///
/// ```
/// # use string_proc::kebab_case;
/// assert_eq!(kebab_case!("brew_coffee"), "brew-coffee");
/// ```
#[macro_export]
macro_rules! kebab_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_kebab_case()
}};
}
/// Convert to PascalCase format (BrewCoffee)
///
/// # Examples
///
/// ```
/// # use string_proc::pascal_case;
/// assert_eq!(pascal_case!("brew_coffee"), "BrewCoffee");
/// ```
#[macro_export]
macro_rules! pascal_case {
($input:expr) => {{
use string_proc::format_processer::FormatProcesser;
FormatProcesser::from($input).to_pascal_case()
}};
}
|