Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type aware properties improvements #674

Open
pnoltes opened this issue Oct 24, 2023 · 2 comments
Open

Type aware properties improvements #674

pnoltes opened this issue Oct 24, 2023 · 2 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@pnoltes
Copy link
Contributor

pnoltes commented Oct 24, 2023

Intro

Improve celix properties so that properties can be stored and loaded to/from file with type information and encode (serialize) to/from netstring with type information.

Store / Load

Ensure that properties stored using celix_properties_store contain type information if the entry is not a string (i.e. long, double, boolean or version) and that properties loaded using celix_properties_load, celix_properties_loadWithStream or celix_properties_loadFromString used the optional type information to load a type aware properties set.

Properties netstring encoding

Add some util functions that can encode/decode a celix properties set to/from a netstring sequence.

The properties can be a netstring sequence where the content is:

  • a number of properties entries in the netstring sequence, where every entry has 3 netstring entries
  • a string key
  • a dfi descriptor type (t (string), J (long), D (double) or Z (boolean) lcelix_version_t; (celix version))
  • a string representation of the value

Array support

Currently properties do not support a array of typed entries.
Support for typed arrays for the following types (string, long, double, bool and celix_version_t) would be nice to have.

@pnoltes pnoltes added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 24, 2023
@PengZheng
Copy link
Contributor

It will be nice to have array support.
If we went one step further to support embedding properties, celix properties will become json.

@pnoltes pnoltes self-assigned this Nov 21, 2023
@pnoltes pnoltes added this to the 3.0.0 milestone Nov 21, 2023
@xuzhenbao xuzhenbao mentioned this issue Nov 28, 2023
pnoltes added a commit that referenced this issue Feb 4, 2024
pnoltes added a commit that referenced this issue Feb 4, 2024
pnoltes added a commit that referenced this issue Feb 5, 2024
pnoltes added a commit that referenced this issue Feb 17, 2024
Also remove support for int, uint, ulong, float and
size as array list element. This is now more aligned
with hash map.
pnoltes added a commit that referenced this issue Feb 25, 2024
Also remove STRING_REF element type.
@pnoltes
Copy link
Contributor Author

pnoltes commented Feb 25, 2024

In PR #727, element types for the array list were introduced.

To ensure the introduction of array list element types is backwards compatible, a potential element type value of CELIX_ARRAY_LIST_ELEMENT_TYPE_UNDEFINED was added. The support for the CELIX_ARRAY_LIST_ELEMENT_TYPE_UNDEFINED element type is intended to be temporary. This addition allows for a separate PR that focuses solely on refactoring Celix array list usage.

  • Create a pull request to remove the CELIX_ARRAY_LIST_ELEMENT_TYPE_UNDEFINED array list element type and the celix_arrayList_create function. Additionally, refactor all instances where the undefined array list usage occurs.

PengZheng added a commit that referenced this issue Mar 28, 2024
…cation.

When compiling a filter, it will try to parse arbitrary string as a version. The string length may exceed 64 bytes and thus will trigger unnecessary dynamic memory allocation.
PengZheng added a commit that referenced this issue Mar 29, 2024
…dle CELIX_ILLEGAL_ARGUMENT of addEntry callback.
PengZheng added a commit that referenced this issue Mar 31, 2024
…ests for filter.

Attributes were ignored when performing equality test between substring filters.
PengZheng added a commit that referenced this issue Apr 1, 2024
It also replaces celix_utils_stringEquals with cheaper celix_utils_isStringNullOrEmpty.
PengZheng added a commit that referenced this issue Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants