Skip to content

Commit 321d204

Browse files
committed
refactor: rename set to setClassname
1 parent df3a90c commit 321d204

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

cpp/HybridStyleRegistry.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace margelo::nitro::cssnitro {
2727
struct HybridStyleRegistry::Impl {
2828
Impl();
2929

30-
void set(const std::string &className, const std::vector<HybridStyleRule> &styleRule);
30+
void
31+
setClassname(const std::string &className, const std::vector<HybridStyleRule> &styleRule);
3132

3233
void addStyleSheet(const HybridStyleSheet &stylesheet);
3334

@@ -97,9 +98,9 @@ namespace margelo::nitro::cssnitro {
9798

9899
HybridStyleRegistry::~HybridStyleRegistry() = default;
99100

100-
void HybridStyleRegistry::set(const std::string &className,
101-
const std::vector<HybridStyleRule> &styleRule) {
102-
impl_->set(className, styleRule);
101+
void HybridStyleRegistry::setClassname(const std::string &className,
102+
const std::vector<HybridStyleRule> &styleRule) {
103+
impl_->setClassname(className, styleRule);
103104
}
104105

105106
void HybridStyleRegistry::addStyleSheet(const HybridStyleSheet &stylesheet) {
@@ -173,8 +174,8 @@ namespace margelo::nitro::cssnitro {
173174
shadowUpdates_ = std::make_unique<ShadowTreeUpdateManager>();
174175
}
175176

176-
void HybridStyleRegistry::Impl::set(const std::string &className,
177-
const std::vector<HybridStyleRule> &styleRules) {
177+
void HybridStyleRegistry::Impl::setClassname(const std::string &className,
178+
const std::vector<HybridStyleRule> &styleRules) {
178179
// Reverse the style rules, this way later on we can bail early if values are already set
179180
auto reversedRules = styleRules;
180181
std::reverse(reversedRules.begin(), reversedRules.end());
@@ -201,8 +202,8 @@ namespace margelo::nitro::cssnitro {
201202
const std::string &className = std::get<0>(entry);
202203
const std::vector<HybridStyleRule> &styleRule = std::get<1>(entry);
203204

204-
// Call set with a vector containing the single styleRule
205-
set(className, styleRule);
205+
// Call setClassname with a vector containing the single styleRule
206+
setClassname(className, styleRule);
206207
}
207208
}
208209
});

cpp/HybridStyleRegistry.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace margelo::nitro::cssnitro {
3636
using SelectorAndArgs = std::tuple<std::string, std::vector<std::string>>;
3737

3838
// ----- public API forwarded to Impl -----
39-
void set(const std::string &className,
40-
const std::vector<HybridStyleRule> &styleRule) override;
39+
void setClassname(const std::string &className,
40+
const std::vector<HybridStyleRule> &styleRule) override;
4141

4242
void addStyleSheet(const HybridStyleSheet &stylesheet) override;
4343

src/specs/StyleRegistry/HybridStyleRegistry.nitro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type HybridStyleRegistry = StyleRegistry & RawStyleRegistry;
66

77
export interface StyleRegistry
88
extends HybridObject<{ ios: "c++"; android: "c++" }> {
9-
set(className: string, styleRule: HybridStyleRule[]): void;
9+
setClassname(classname: string, styleRule: HybridStyleRule[]): void;
1010
addStyleSheet(stylesheet: HybridStyleSheet): void;
1111
getDeclarations(
1212
componentId: string,

0 commit comments

Comments
 (0)