Matthias Beyer
db7121ccba
Rewrite library
...
* Remove old code
* Rewrite with tests
This implements a fassade pattern for ref library
With the fassade, we can specify the hasher in a rather easy way, which
is not possible with default generics for traits.
The "default" part in "default generic type" is not properly implemented
yet (as visible in the tests), as I don't know how to realize this.
For simplicity, the `hasher` module exports a `default` module with a
`DefaultHasher` type, which resolves to the `Sha1Hasher`.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 11:09:48 +01:00
Matthias Beyer
820ac41443
Add trace output
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 10:47:46 +01:00
Matthias Beyer
84c6a1981e
Fix: If the field is not available, return false
...
The function is for checking whether a flag is set. If the flag is not
available, the flag is obviously not set.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 10:47:46 +01:00
Matthias Beyer
8fb4bcf0c6
Fix for new StoreId::new() interface
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
972cba7c31
Adapt to new libimagstore::iter::Entries API
...
Use Entries::into_storeid_iter() for transforming iterator into right
type.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
f64b87b4a8
Adapt to new libimagstore::iter::Entries API
...
Use Entries::into_storeid_iter() for transforming iterator into right
type.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
c6cc1804e7
Adapt to new libimagstore::iter::Entries API
...
Use Entries::into_storeid_iter() for transforming iterator into right
type.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
14a2485a8a
Change signature: Link::exists(&Store)
...
This change is necessary because we need the store now to check whether
a StoreId exists.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
429ef9bc4c
Fix libimagentrylink for new StoreId API
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:29 +01:00
Matthias Beyer
642702b724
Rewrite: StoreId::new_baseless() -> StoreId::new()
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:28 +01:00
Matthias Beyer
b66371f79b
Rewrite Store::new* API: libimagstore does not export backend types
...
With this change applied, libimagstore does not export backend
representing types anymore.
This change is necessar because when we want to switch the `StoreId`
implementation from "complex and stateful" to "Stateless and Cow<'_,
&str>", we need to be able to have a type which represents a "`StoreId`
plus the path of the Store itself".
This "the path of the Store itself" is passed around as reference, to
minimize runtime impact.
Because such a type should not be exported by the libimagstore crate, we
make it `pub(crate)` internally. But because the backend APIs also have
to use this type, we would export the (private) type in the APIs of the
backend.
Because of that we make the backend API also non-visible to crate users,
which also decreases the surface of the libimagstore API itself.
Besides:
Remove function `Link::with_base()` which is not needed anymore (was
used in tests only).
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-15 20:53:28 +01:00
Matthias Beyer
171b42307d
Add feature to trim content on the right
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:52:04 +01:00
Matthias Beyer
19912f5e88
Add Is::remove_isflag() for removing header flags
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:22:56 +01:00
Matthias Beyer
03e0864268
Merge branch 'unnamed-annotations' into master-ff
...
This merge adds several patches to improve libimagannotation and
imag-annotate.
2019-02-10 17:07:35 +01:00
Matthias Beyer
d8cd10a384
Remove iterator types
...
With this patch, libimagentryannotation does not have special iterator
types anymore. This makes the whole thing more comfortable to use.
In imag-annotate, the parameter for the functioncall was removed.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 01:00:33 +01:00
Matthias Beyer
ed01f8b463
Make annotations unnamed (automatically UUID named)
...
It makes no sense to name annotations, a user only cares about whether
there are annotations or not, or their contents. A name has no meaning
in this context.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-10 00:58:21 +01:00
Matthias Beyer
afe275692e
Fix: Do not use deprecated StoreId::exists() function
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-09 01:03:28 +01:00
Matthias Beyer
9185abcfa5
Update copyright years
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00
Matthias Beyer
1ce780795a
Do not use StoreId::local() here
2018-11-26 18:19:10 +01:00
Matthias Beyer
496c06d15a
Update lazy_static to 1.2
...
1.2 of lazy_static brings functionality to have no panics in the code,
which is what we try to have.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-11 13:05:55 +01:00
Matthias Beyer
9fca66aa89
Forbid unsafe code in all crates
2018-11-11 13:05:55 +01:00
Matthias Beyer
4e516ee19d
Update version strings
...
...for the next release, which will be imag 0.10.0!
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-10 11:56:37 +01:00
Matthias Beyer
17d4123898
Update dependencies from git versions to proper versions.
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 22:14:11 +01:00
Matthias Beyer
d1f087eb57
Change libimag{bookmark, entrylink} external linking
...
...to report newly created entries, so that we can re-use these new
entries in the library-using code (for example for ID reporting).
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:33:30 +01:00
Matthias Beyer
a45691ef27
Change test output to use debug!()
2018-11-01 20:37:02 +01:00
Matthias Beyer
1f5b490dd7
Change test output to use debug!()
2018-11-01 20:37:02 +01:00
Matthias Beyer
83876b7c2c
Change test output to use debug!()
2018-11-01 20:37:02 +01:00
Matthias Beyer
366ca62eb9
Update dependency: mdcat: 0.8 -> 0.11
2018-10-31 17:15:29 +01:00
Matthias Beyer
a1c65603dc
libimagentrydatetime: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
f3e7f677b0
libimagentryutil: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
e553d20a8f
libimagentrymarkdown: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
ebe2a9a110
libimagentryview: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
9b48dc27cd
libimagentryref: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
5a7def4c8e
libimagentryedit: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
7f04eb2bff
libimagentrygps: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
0cbc6741a7
libimagentrytag: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
32e8c43ccb
libimagentrylink: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
7357f1c985
libimagentryannotation: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
a8daeb851d
libimagentrycategory: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
49ec0702fd
libimagentryfilter: Move from error-chain to failure
...
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer
a0730c0ca9
Roll back mdcat update
...
Because 0.8 -> 0.10 has changed the API, we cannot update trivially.
Revert the update because of that.
2018-10-06 12:22:15 +02:00
Matthias Beyer
5d901ae411
Update dependencies
...
regex: 0.2 -> 1
semver: 0.8 -> 0.9
2018-10-06 12:22:15 +02:00
Matthias Beyer
0069463e46
Update dependencies
...
mdcat: 0.8 -> 0.10
textwrap: 0.9 -> 0.10
2018-10-06 12:21:20 +02:00
Matthias Beyer
155a6aeca9
Update dependency: regex: 0.2 -> 1
2018-10-06 12:21:20 +02:00
Matthias Beyer
1fa9b86531
Update dependency: lazy_static: 0.2 -> 1
2018-09-27 15:05:45 +02:00
Matthias Beyer
3d12998603
Update dependency: toml-query: 0.6 -> 0.7
2018-09-27 15:05:44 +02:00
Matthias Beyer
0a7afee454
Update dependency: error-chain: 0.11 -> 0.12
2018-09-27 15:05:25 +02:00
newpavlov
04b3e7243d
replaced rust-crypto with RustCrypto crates
2018-07-18 19:51:05 +03:00
Matthias Beyer
2e41656d1a
Fix comment for rustc 1.26
2018-05-11 14:55:23 +02:00
Matthias Beyer
664edc7943
Update version string: 0.8.0 -> 0.9.0
2018-05-09 11:39:33 +02:00
Matthias Beyer
2e2bce77a0
Add functionality to remove categories
2018-05-04 11:09:20 +02:00
Matthias Beyer
84f426297e
Add debug output
2018-05-01 22:29:46 +02:00
Matthias Beyer
2f0a557068
Fix for passing Arc<_> to store interface instead of Box<_>
2018-05-01 21:08:57 +02:00
Matthias Beyer
6ee3f4a3f6
Refactor libimagentrycategory to fit new store iterator interface
2018-05-01 17:44:01 +02:00
Matthias Beyer
6f81d02445
Refactor libimagentryannotation to fit new store iterator interface
2018-05-01 17:44:01 +02:00
Matthias Beyer
fc92cfc36f
Move header filters to FailableFilter
2018-04-29 11:43:32 +02:00
Matthias Beyer
30ac77d626
Add error module
2018-04-29 11:43:32 +02:00
Matthias Beyer
e08ec34893
Remove empty module
2018-04-29 11:43:32 +02:00
Matthias Beyer
6d21d8eb49
Update dependency: filters: 0.2 -> 0.3
2018-04-29 10:46:36 +02:00
Matthias Beyer
93c3bb5862
Upgrade variables to 64 bit
2018-04-28 23:27:12 +02:00
Matthias Beyer
5870fa0785
Fix: Use 16 bit variables for GPS degree/minute/second
2018-04-28 23:18:02 +02:00
Matthias Beyer
82867f3ff6
Fix tests for new interface
2018-04-27 13:24:59 +02:00
Matthias Beyer
f0969db47c
Rewrite
...
This patch rewrites the whole libimagcategory and brings it to a nice
standard (the code before was rather messy).
Now, categories are represented by an entry in the store and all entries
which have this category are linked to that entry.
2018-04-26 12:05:28 +02:00
Matthias Beyer
9fc9e7fe17
Outsource iterator in iter module
2018-04-26 12:05:28 +02:00
Matthias Beyer
ab15d89e64
Rewrite CategoryRegister as CategoryStore
2018-04-26 12:05:28 +02:00
Matthias Beyer
5f305ef7a7
Add module for category handling
2018-04-26 12:05:28 +02:00
Matthias Beyer
c26f1aae2a
This module should be named "entry"
2018-04-26 11:20:40 +02:00
Matthias Beyer
f321aa82a1
Make sure category is linked when setting it
2018-04-26 11:20:09 +02:00
Matthias Beyer
ea80a5a09b
Derive Default for InMemoryFileAbstraction, remove constructor
2018-04-25 19:15:07 +02:00
Matthias Beyer
d12844aff0
Add markdown viewer functionality
2018-04-24 18:06:45 +02:00
Matthias Beyer
780dd90c8f
Rewrite libimagentryview interface
...
In the previous versions, the sink (where the entries should be written
to) was not passed.
This did conflict with the libimagrt holding the stdout/stderr handles,
because it automatically writes to stdout (which we don't want to do in
some cases).
Passing the sink is way nicer. This patch changes libimagentryview so
that the sink is passed to the viewer.
2018-04-24 16:46:15 +02:00
Matthias Beyer
190da895f9
Do not use Store::retrieve_for_module() anymore here
2018-04-24 13:40:42 +02:00
Matthias Beyer
007c02c2f1
Rewrite all_category_names() for removed Store::retrieve_for_module()
2018-04-24 13:40:42 +02:00
Matthias Beyer
91a72709f8
Add wrapping functionality to StdoutViewer
2018-04-19 21:54:39 +02:00
Matthias Beyer
d2dceb6640
Update version numbers: 0.7.0 -> 0.8.0
2018-04-19 10:05:53 +02:00
Matthias Beyer
4568b1f625
Merge pull request #1380 from matthiasbeyer/minor
...
Minor patches
2018-04-18 16:46:41 +02:00
Matthias Beyer
98f8366e4c
Fix documentation in crate metadata
2018-04-17 15:55:08 +02:00
Matthias Beyer
40b85f13b5
Add lints
2018-04-14 00:41:31 +02:00
Matthias Beyer
76c8443e50
Merge pull request #1395 from matthiasbeyer/clap-text-wrap
...
Clap text wrap
2018-04-13 22:46:09 +02:00
Matthias Beyer
3819dabff1
Remove attribute
...
This fixes a crash with the (beta) compiler rustc 1.26.
2018-04-13 16:41:42 +02:00
Matthias Beyer
aeec10bf76
Use clap with wrap_help feature
2018-04-13 16:19:10 +02:00
Matthias Beyer
b59c234588
Use clap "^2.29" instead of ">=2.29"
2018-04-13 16:17:43 +02:00
Matthias Beyer
731b97cccb
Fix: Pass the right path variable here
...
The ref library passed the wrong variable as path which caused the
setting in the entries to be wrong.
This patch fixes this.
2018-04-13 14:06:15 +02:00
Matthias Beyer
e61ccc9561
Fix: Entry::to_str() should return Result<_>
...
Because serializing might fail.
Also fixes all usages of the API.
2018-03-26 14:24:42 +02:00
Matthias Beyer
7429754665
Rewrite edit_in_tmpfile() for new Runtime::editor() signature
2018-03-23 23:55:11 +01:00
Matthias Beyer
13af364b76
Add header editing support
2018-03-23 17:16:40 +01:00
Matthias Beyer
6f33e4e322
Add debug output
2018-03-23 10:05:58 +01:00
Matthias Beyer
3d7be3a1e0
Merge pull request #1349 from matthiasbeyer/libimagentryref/fixes
...
Fix: Allocating of buffer does not work as expected with Vec::with_ca…
2018-03-21 18:04:37 +01:00
Matthias Beyer
d2eb4936b1
Fix: Allocating of buffer does not work as expected with Vec::with_capacity()
2018-03-20 16:51:19 +01:00
Matthias Beyer
5ceeacd6c8
Provide Ref::make_ref() for making a ref out of an existing entry
2018-03-19 14:18:02 +01:00
Matthias Beyer
6055520519
Provide unlink() to remove all links
2018-02-25 18:59:02 +01:00
Matthias Beyer
5773e8a6c8
Remove libimagentrylist
2018-02-20 15:02:46 +01:00
Matthias Beyer
027c4b3287
Remove usage of libimagentrylist
2018-02-20 15:02:46 +01:00
Matthias Beyer
c36250e42f
Adapt to new libimagentryref API
2018-02-19 12:15:31 +01:00
Matthias Beyer
1153fb180b
Add function to delete a reference header entry
2018-02-19 12:14:32 +01:00
Matthias Beyer
fd6a7f877a
Remove private macro
2018-02-19 12:14:32 +01:00
Matthias Beyer
a1a85f40d0
Add default generators
2018-02-19 12:14:32 +01:00
Matthias Beyer
2328c8b2b0
Take AsRef<str> rather than &String
2018-02-19 12:14:32 +01:00
Matthias Beyer
cbb47cffcb
Implement Ref functions
2018-02-19 12:14:32 +01:00
Matthias Beyer
ed69fd4b35
Enrich error types
2018-02-19 12:14:32 +01:00