From fac2c8a7ce61814fea39bb86ace971f7709f7b22 Mon Sep 17 00:00:00 2001 From: Arek Sredzki Date: Thu, 17 Jan 2019 10:31:16 -0800 Subject: [PATCH] Fix various grammatical and spelling mistakes within the docs --- README.md | 2 +- doc/design/README.md | 10 +++++----- doc/tutorial/hello_world.md | 17 ++++++++++------- include/bitsery/adapter_reader.h | 2 +- include/bitsery/common.h | 2 +- include/bitsery/details/not_defined_type.h | 2 +- tests/serialization_test_utils.h | 2 +- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index fe32b78..7ad1c88 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ All cross-platform requirements are enforced at compile time, so serialized data * fine-grained bit-level serialization control. * Easily extendable for any type. * Allows flexible or/and verbose syntax for better serialization control. -* Configurable endianess support. +* Configurable endianness support. * No macros. ## Why to use bitsery diff --git a/doc/design/README.md b/doc/design/README.md index 4729b03..cc685ee 100644 --- a/doc/design/README.md +++ b/doc/design/README.md @@ -33,12 +33,12 @@ Now let's review features in more detail. * **Cross-platform compatible.** if same code compiles on Android, PS3 console, and your PC either x64 or x86 architecture, you are 100% sure it works. To achieve this, bitsery specifically defines size of underlying data, hence syntax is *value\<2\>* (alias function *value2b*) instead or *value*, or *container2b* for element type of 16bits, eg int16_t. -Bitsery also applies endianess transformation if nessesarry. -* **Flexible syntax.** if you don't like like writing code with explicitly specifying underlying type size, like *container2b* or *value8b* you can use flexible syntax. +Bitsery also applies endianness transformation if necessary. +* **Flexible syntax.** If you don't like like writing code with explicitly specifying underlying type size, like *container2b* or *value8b*, you can use flexible syntax. Just include and can write like in [cereal](http://uscilab.github.io/cereal/). -But do it on your own risk, and static assert using *assertFundamentalTypeSizes* function if you're planing to use it accross multiple platforms. +But do it on your own risk, and static assert using *assertFundamentalTypeSizes* function if you're planing to use it across multiple platforms. * **Optimized for speed and space.** library itself doesn't do any allocations (except if you use backward/forward compatibility) so data writing/reading is fast as memcpy to/from your buffer. -It also doesn't serialize any type information, all information needed is writen in your code! +It also doesn't serialize any type information, all information needed is written in your code! * **No code generation required: no IDL or metadata** since it doesn't support any other formats except binary, it doesn't need any metadata. * **Runtime error checking on deserialization** library designed to be save with untrusted network data, that's why all overloads that work on containers has *maxSize* value, unless container is static size like *std::array*, this way bitsery ensures that no malicious data crash you. * **Supports forward/backward compatibility for your types** library has optional forward/backward compatibility for types implemented in *AdapterReader/Writer* by allowing to have inner data sessions inside buffer. @@ -65,5 +65,5 @@ Bitsery allows to use bit-level operations and has two extensions that use them: You want to support your custom container, its fine there is *ContainerTraits* for this, only few methods required to implement. To use same container for buffer writing/reading add specialization to *BufferAdapterTraits*. You want to customize serialization flow - use extensions, only two methods to define, and *ExtensionTraits* to further customize usage. -* **Configurable endianess support.** default is *Little Endian*, but if your primary target is PowerPC architecture, eg. PlayStation3, just change your configuration to be *Big Endian*. +* **Configurable endianness support.** default is *Little Endian*, but if your primary target is PowerPC architecture, eg. PlayStation3, just change your configuration to be *Big Endian*. * **No macros.** Not so much to say, if you are like me, then it's a feature :) diff --git a/doc/tutorial/hello_world.md b/doc/tutorial/hello_world.md index 4df6c47..fef5283 100644 --- a/doc/tutorial/hello_world.md +++ b/doc/tutorial/hello_world.md @@ -2,11 +2,11 @@ This is a quick guide to get **bitsery** up and running in a matter of minutes. The only prerequisite for running bitsery is a modern C++11 compliant compiler, such as GCC 4.9.4, clang 3.4, MSVC 2015, or newer. -Older versions might work, but it is not tested. +Older versions might work, but they have not been tested. ## Get bitsery -bitsery can be directly included in your project or installed anywhere you can access header files. +**bitsery** can be directly included in your project or installed anywhere you can access header files. Grab the latest version, and include directory `bitsery_base_dir/include/` to your project. There's nothing to build or make - **bitsery** is header only. @@ -27,11 +27,14 @@ using InputAdapter = InputBufferAdapter; ``` **bitsery** is very lightweight, so we need to explicitly include what we need. -* `` is a core header, that includes our Serializer and Deserializer -* `` in order to write/read data we need specific adapter, depending on what underlying buffer will be. In this example we'll be using std::vector as our buffer, so we include buffer adapter. -* traits tells library how efficiently serialize particular container. -create alias types for *InputAdapter* and *OutputAdapter* using our vector as buffer. +Include | Description +--|-- +`` | This is a core header, that includes our Serializer and Deserializer. +`` | In order to write/read data, we need a specific adapter, depending on what underlying buffer will be. In this example, we'll be using `std::vector` as our buffer, so we include the buffer adapter. +`` | Traits tell the library how to efficiently serialize a particular container. Many common STL containers are supported out of the box. + +Create alias types for *InputAdapter* and *OutputAdapter* using our vector as buffer. ## Add serialization method for your type @@ -124,4 +127,4 @@ int main() { } ``` -**currently documentation and tutorial is progress, but for more usage examples see examples folder** \ No newline at end of file +**currently documentation and tutorial is progress, but for more usage examples see examples folder** diff --git a/include/bitsery/adapter_reader.h b/include/bitsery/adapter_reader.h index 0687154..f559257 100644 --- a/include/bitsery/adapter_reader.h +++ b/include/bitsery/adapter_reader.h @@ -124,7 +124,7 @@ namespace bitsery { void directRead(T *v, size_t count) { static_assert(!std::is_const::value, ""); _inputAdapter.read(reinterpret_cast(v), sizeof(T) * count); - //swap each byte if nessesarry + //swap each byte if necessary _swapDataBits(v, count, std::integral_constant{}); } diff --git a/include/bitsery/common.h b/include/bitsery/common.h index 27c439e..b41a9e9 100644 --- a/include/bitsery/common.h +++ b/include/bitsery/common.h @@ -29,7 +29,7 @@ namespace bitsery { /* - * endianess + * endianness */ enum class EndiannessType { LittleEndian, diff --git a/include/bitsery/details/not_defined_type.h b/include/bitsery/details/not_defined_type.h index d91fd78..346ba66 100644 --- a/include/bitsery/details/not_defined_type.h +++ b/include/bitsery/details/not_defined_type.h @@ -35,7 +35,7 @@ namespace bitsery { NotDefinedType(T&& ...){} NotDefinedType() = default; //define operators so that we also swallow deeper errors, to reduce error stack - //this time will be used as iterator, so define all operators nessesarry to work with iterators + //this time will be used as iterator, so define all operators necessary to work with iterators friend bool operator == (const NotDefinedType&, const NotDefinedType&) { return true; } diff --git a/tests/serialization_test_utils.h b/tests/serialization_test_utils.h index 85b966a..b4b008a 100644 --- a/tests/serialization_test_utils.h +++ b/tests/serialization_test_utils.h @@ -134,7 +134,7 @@ public: } //since all containers .size() method returns size_t, it cannot be directly serialized, because size_t is platform dependant - //this function returns number of bytes writen to buffer, when reading/writing size of container + //this function returns number of bytes written to buffer, when reading/writing size of container static size_t containerSizeSerializedBytesCount(size_t elemsCount) { if (elemsCount < 0x80u) return 1;