Skip to content

Commit 3fd87fc

Browse files
committed
Update README.md
1 parent 4354921 commit 3fd87fc

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Marsy is a library that allow you to deserialize and manage data returned by [Sp
1010
- [Start](#start)
1111
- [Queries](#queries)
1212
- [Size of binary in debug mode](#size-of-binary-in-debug-mode)
13-
- [There's few things that Marsy doesn't provide](#theres-few-things-that-marsy-doesnt-provide)
13+
- [Things you should be aware of](#things-you-should-be-aware-of)
1414
- [Internet connection](#internet-connection)
1515
- [Dates parsing](#dates-parsing)
1616
- [Sample code](#sample-code)
@@ -21,7 +21,7 @@ Marsy is a library that allow you to deserialize and manage data returned by [Sp
2121
## Start
2222
To use it just add source files to your project.
2323

24-
You can use functions provided by services or write your own services on top of provided parsers. Remember to look [here](#theres-few-things-that-marsy-doesnt-provide) before start.
24+
You can use functions provided by services or write your own services on top of provided parsers. Remember to look [here](#things-you-should-be-aware-of) before start.
2525

2626
Library uses C++17 features. You need to remember it, when you compile your program.
2727

@@ -44,14 +44,17 @@ Currently Marsy doesn't provide query builder for these: `options -> select`, `o
4444
## Size of binary in debug mode
4545
Since Marsy includes [JSON](https://github.com/nlohmann/json) in several classes, output program can be huge when compiled in debug mode (I achieved 60MB binaries). Remember to roll it out as release, when you done with testing.
4646

47-
# There's few things that Marsy doesn't provide
47+
# Things you should be aware of
4848
## Internet connection
4949
Marsy doesn't handle internet connection, so you need to provide implementation of `IConnection` interface. Enum `ResponseStatus` is to help you handle different statuses returned by API. Service will parse returned JSON only when status is `ResponseStatus::ok`.
5050

5151
There are 2 reasons why I made is as it is:
5252
* C++ doesn't have internet connection in STL yet. I did not want to include big library or use different system APIs to provide support for more than one platform e.g. (WinAPI, POSIX etc.),
5353
* maybe you already have library with internet connection in your project or you want to use one that you like the most.
5454

55+
**However**
56+
I made `IConnector` implementation based on curl and curlcpp. You can find it [here](https://github.com/AzuxDario/Marsy-CurlConnector).
57+
5558
## Dates parsing
5659
Marsy doesn't parse dates returned by API. They're stored as strings.
5760

@@ -60,18 +63,14 @@ Marsy doesn't parse dates returned by API. They're stored as strings.
6063
#include <iostream>
6164
#include <memory>
6265

63-
// Implementation isn't provided by Marsy.
64-
#include "Connection/Implementation/MyConnector.h"
66+
#include "Connection/Implementation/CurlConnector.h"
6567
#include "Services/Capsules/CapsuleService.h"
6668

67-
using Marsy::Connection::IConnector;
68-
using Marsy::Models::CapsuleModel::CapsuleModel;
69-
using Marsy::Services::CapsuleService::CapsuleService;
70-
using Marsy::Services::ServiceResponse;
69+
using namespace Marsy;
7170

7271
int main()
7372
{
74-
std::shared_ptr<IConnector> conn = std::make_shared<MyConnector>();
73+
std::shared_ptr<IConnector> conn = std::make_shared<CurlConnector>();
7574
CapsuleService capsuleService(conn);
7675
ServiceResponse<CapsuleModel> capsuleResponse = capsuleService.getCapsule("5e9e2c5bf35918ed873b2664");
7776
CapsuleModel capsule = capsuleResponse.object;

0 commit comments

Comments
 (0)