File: README.md

package info (click to toggle)
libpmemobj-cpp 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,568 kB
  • sloc: cpp: 14,128; sh: 643; ansic: 497; perl: 381; makefile: 8
file content (47 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Basic usage:

After [building](https://github.com/pmem/libpmemobj-cpp#how-to-build) the source, navigate to the `/build/examples/` directory. Operations include: `alloc`, `realloc`, `free`, and `print`.

 `$ ./example-array <file_name> [print|alloc|free|realloc] <array_name>`

## Options:

### Alloc:

`$ ./example-array <file_name> alloc <array_name> <size>`

Example:
```
$ ./example-array file alloc myArray 4
$ ./example-array file print myArray
    myArray = [0, 1, 2, 3]
```

### Realloc:

`$ ./example-array <file_name> realloc <array_name> <size>`

Example:
```
$ ./example-array file realloc myArray 7
$ ./example-array file print myArray
    myArray = [0, 1, 2, 3, 0, 0, 0]
```

### Free:

`$ ./example-array <file_name> free <array_name>`

Example:
```
$ ./example-array file free myArray
$ ./example-array file print myArray
    No array found with name: myArray
```

### Print:

`$ ./example-array <file_name> print <array_name>`

Example output can be seen in above example sections.