变体数据类型库对于C

编程入门 行业动态 更新时间:2024-10-25 18:30:29
本文介绍了变体数据类型库对于C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否有存储和处理结果一个体面的开源C库动态类型变量(亦称变种)?我在原子值(INT8,INT16,INT32,UINT,字符串,斑点等)的主要兴趣,而JSON风格的数组和对象以及自定义对象也将是不错。其中,这样的库将是有益的一个重要案例是使用SQL数据库。

Is there a decent open-source C library for storing and manipulating dynamically-typed variables (a.k.a. variants)? I'm primarily interested in atomic values (int8, int16, int32, uint, strings, blobs, etc.), while JSON-style arrays and objects as well as custom objects would also be nice. A major case where such a library would be useful is in working with SQL databases.

这样的库的最明显的特征是对所有支持的价值观单一类型的,例如:

The most obvious feature of such a library would be a single type for all supported values, e.g.:

struct Variant { enum Type type; union { int8_t int8_; int16_t int16_; // ... }; };

其他功能可能包括转换变反对/从C结构(使用绑定表),从字符串值转换为/,并集成了现有的数据库的库如SQLite的。

Other features might include converting Variant objects to/from C structures (using a binding table), converting values to/from strings, and integration with an existing database library such as SQLite.

请注意:我不认为这是问题的stackoverflow/questions/649649/any-library-for-generic-datatypes-in-c ,这是指队列,树,地图,列表。我说的是更侧重于制定与SQL数据库大致顺利,因为在跨preTED语言与他们合作的工作。

Note: I do not believe this is question is a duplicate of stackoverflow/questions/649649/any-library-for-generic-datatypes-in-c , which refers to "queues, trees, maps, lists". What I'm talking about focuses more on making working with SQL databases roughly as smooth as working with them in interpreted languages.

推荐答案

GLib的具有实施的GValue的形式一般价值类型: library.gnome/devel/gobject/unstable /gobject-Generic-values​​.html

GLib has implementation of generic value types in form of GValue: library.gnome/devel/gobject/unstable/gobject-Generic-values.html

更多推荐

变体数据类型库对于C

本文发布于:2023-10-27 15:26:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1533784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变体   数据类型

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!