Added docs to readme.
This commit is contained in:
192
README.md
192
README.md
@@ -1,2 +1,194 @@
|
||||
# Pickler
|
||||
__Pickler__ is a testing sweet centered around pickles.
|
||||
|
||||
# How To Use
|
||||
To init the Pickler Lib first include Pickler.h
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
```
|
||||
After includeing Pickler next we need to init Pickler. This is vary simple. Just
|
||||
add into your `int main()` `CREATESHELF` This creates a safe place to put your pickle
|
||||
jars.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
}
|
||||
```
|
||||
Once The shelf is created we can create __Pickle Jars__. To Create a pickle jar
|
||||
call `CREATEJAR(name)` This will create a pickle jar. The __Pickle Jar must be created
|
||||
after the shelf.__ The Pickle Jar requires a name. __This name should be entererd in
|
||||
plain text and with no speshial characters and should be treated like a varaible name.__
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
}
|
||||
```
|
||||
Next we can make __Pickles__. To Create a Pickle just use the `PICKLE' macro.
|
||||
Treate this like a lambda expretion. A Pickle should look like this.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
}();
|
||||
}
|
||||
```
|
||||
To make the pickle functions not throw a error you must add a `ASSERT(message, passed)`. The assert
|
||||
will reporte to the pickle jar to tell the pickle jar to see if the _pickle was droped_
|
||||
or was _pickled_. (Faled or Successed). Here is how to use the `ASSERT(message, passed)`.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will faile", false)
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", true)
|
||||
}();
|
||||
}
|
||||
```
|
||||
There are two objects that will make the assert a little easier to use. There is
|
||||
`SAME(value1,value2)` and `DIFFERENT(value1,value2)` that will test to see if the
|
||||
objects are the same or they are different.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", DIFFERENT(1,2))
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", SAME(2,2))
|
||||
}();
|
||||
}
|
||||
```
|
||||
Now we need to add pickles to the pickle jar. To add pickles to the pickle jar use
|
||||
`ADDPICKLETOJAR(jar,pickle)` to add a pickle to a pickle jar.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", DIFFERENT(1,2))
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", SAME(2,2))
|
||||
}();
|
||||
|
||||
// Adding pickls to pickle jar
|
||||
ADDPICKLETOJAR(jar_name, pickle_name);
|
||||
ADDPICKLETOJAR(jar_name, pickle_name2);
|
||||
}
|
||||
```
|
||||
The pickles have now been added to the pickle jar, but now we need to add the
|
||||
pickle jar to the pickle shelf. To do this just simply add `ADDJARTOSHELF(jar)`.
|
||||
This macro will add the pickle jar to the shelf.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", DIFFERENT(1,2))
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", SAME(2,2))
|
||||
}();
|
||||
|
||||
// Adding pickls to pickle jar
|
||||
ADDPICKLETOJAR(jar_name, pickle_name);
|
||||
ADDPICKLETOJAR(jar_name, pickle_name2);
|
||||
|
||||
// Adding pickle jar to pickle shelf.
|
||||
ADDJARTOSHELF(jar_name);
|
||||
}
|
||||
```
|
||||
Now The last step to use Pickler. For the return of main just return `PICKLESHELF`.
|
||||
Thats it.
|
||||
```C++
|
||||
#include "Pickler.h"
|
||||
|
||||
int main() {
|
||||
// init the shelf
|
||||
CREATESHELF();
|
||||
|
||||
// Creating Pickle Jar
|
||||
CREATEJAR(jar_name);
|
||||
|
||||
// Creating a pickle
|
||||
PICKLE(pickle_name) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", DIFFERENT(1,2))
|
||||
}();
|
||||
PICKLE(pickle_name2) {
|
||||
// test contents.
|
||||
ASSERT("This is a test that will successed", SAME(2,2))
|
||||
}();
|
||||
|
||||
// Adding pickls to pickle jar
|
||||
ADDPICKLETOJAR(jar_name, pickle_name);
|
||||
ADDPICKLETOJAR(jar_name, pickle_name2);
|
||||
|
||||
// Adding pickle jar to pickle shelf.
|
||||
ADDJARTOSHELF(jar_name);
|
||||
|
||||
return PICKLESHELF;
|
||||
}
|
||||
```
|
||||
Now you are a master of pickling software. Use these skills as a Pickler master
|
||||
wizly because now you hold a great power of pickling software.
|
||||
|
||||
Reference in New Issue
Block a user