Skip to content

Commit 0772374

Browse files
docs: Update abseil replacement
1 parent 645d073 commit 0772374

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ See [Serializers](docs/serializers.md) for details.
122122
### Requirements
123123

124124
- C++20 compiler (GCC 11+, Clang 14+)
125-
- [Abseil](https://github.com/abseil/abseil-cpp) (for `absl::Status`)
125+
- No external dependencies for the core library
126126

127127
### Optional Dependencies
128128

@@ -151,7 +151,7 @@ set(CPPFIG_ENABLE_JSON ON)
151151
Core (`.conf` only, no extra dependencies):
152152

153153
```bash
154-
vcpkg install abseil
154+
# No additional packages needed — cppfig is fully self-contained
155155
```
156156

157157
With JSON support:
@@ -322,12 +322,12 @@ cppfig::Configuration<Schema,
322322
ThreadPolicy = SingleThreadedPolicy>
323323

324324
// Methods
325-
auto Load() -> absl::Status;
326-
auto Save() const -> absl::Status;
325+
auto Load() -> cppfig::Status;
326+
auto Save() const -> cppfig::Status;
327327
auto Get<Setting>() const -> typename Setting::value_type;
328-
auto Set<Setting>(value) -> absl::Status;
328+
auto Set<Setting>(value) -> cppfig::Status;
329329
auto Diff() const -> ConfigDiff;
330-
auto ValidateAll() const -> absl::Status;
330+
auto ValidateAll() const -> cppfig::Status;
331331
auto GetFilePath() const -> std::string_view;
332332

333333
// Thread policies

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To also enable the optional JSON serializer:
4747
### Requirements
4848

4949
- C++20 compatible compiler (GCC 11+, Clang 14+)
50-
- [Abseil](https://github.com/abseil/abseil-cpp) (for `absl::Status` and `absl::StatusOr`)
50+
- No external dependencies for the core library
5151

5252
#### Optional Dependencies
5353

docs/serializers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct MyFormatSerializer {
109109
using data_type = cppfig::Value;
110110

111111
// Required: parse from input stream into a Value tree
112-
static auto Parse(std::istream& is) -> absl::StatusOr<cppfig::Value> {
112+
static auto Parse(std::istream& is) -> cppfig::StatusOr<cppfig::Value> {
113113
// ... read and convert to cppfig::Value ...
114114
}
115115

@@ -139,7 +139,7 @@ A serializer must provide:
139139
| Member | Signature | Purpose |
140140
|--------|-----------|---------|
141141
| `data_type` | type alias (`Value`) | Internal data representation |
142-
| `Parse` | `(std::istream&) → absl::StatusOr<Value>` | Parse from stream |
142+
| `Parse` | `(std::istream&) → StatusOr<Value>` | Parse from stream |
143143
| `Stringify` | `(const Value&) → std::string` | Convert to string |
144144

145145
Path navigation (`GetAtPath`, `SetAtPath`, `HasPath`) and merging are handled
@@ -158,7 +158,7 @@ if (result.ok()) {
158158
}
159159

160160
// Write a Value tree to a file
161-
absl::Status status = cppfig::WriteFile<cppfig::ConfSerializer>(
161+
cppfig::Status status = cppfig::WriteFile<cppfig::ConfSerializer>(
162162
"config.conf", my_data
163163
);
164164
```

docs/testing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ TEST(ServiceTest, InitializeLoadsConfig) {
141141
cppfig::testing::MockVirtualConfigurationProvider mock_config;
142142

143143
EXPECT_CALL(mock_config, Load())
144-
.WillOnce(testing::Return(absl::OkStatus()));
144+
.WillOnce(testing::Return(cppfig::OkStatus()));
145145

146146
Service service(mock_config);
147147
EXPECT_NO_THROW(service.Initialize());
@@ -151,7 +151,7 @@ TEST(ServiceTest, InitializeFailsOnLoadError) {
151151
cppfig::testing::MockVirtualConfigurationProvider mock_config;
152152

153153
EXPECT_CALL(mock_config, Load())
154-
.WillOnce(testing::Return(absl::InternalError("File not found")));
154+
.WillOnce(testing::Return(cppfig::InternalError("File not found")));
155155

156156
Service service(mock_config);
157157
EXPECT_THROW(service.Initialize(), std::runtime_error);
@@ -165,10 +165,10 @@ GMock-compatible mock for the virtual interface:
165165
```cpp
166166
class MockVirtualConfigurationProvider : public IConfigurationProviderVirtual {
167167
public:
168-
MOCK_METHOD(absl::Status, Load, (), (override));
169-
MOCK_METHOD(absl::Status, Save, (), (const, override));
168+
MOCK_METHOD(cppfig::Status, Load, (), (override));
169+
MOCK_METHOD(cppfig::Status, Save, (), (const, override));
170170
MOCK_METHOD(std::string_view, GetFilePath, (), (const, override));
171-
MOCK_METHOD(absl::Status, ValidateAll, (), (const, override));
171+
MOCK_METHOD(cppfig::Status, ValidateAll, (), (const, override));
172172
MOCK_METHOD(std::string, GetDiffString, (), (const, override));
173173
};
174174
```

0 commit comments

Comments
 (0)