macmade / cfpp Goto Github PK
View Code? Open in Web Editor NEWC++ wrapper for CoreFoundation base classes.
License: MIT License
C++ wrapper for CoreFoundation base classes.
License: MIT License
Version 0.1.0 is broken on Windows using VisualStudio.
The use of CFStreamProperty symbols prevents CoreFoundation.dll
to be delay-loaded.
E.g.:
__imp__kCFStreamPropertyFileCurrentOffset
Declared in CFBundle:
String GetLocalizedString( String key, const char * comment );
String GetLocalizedStringFromTable( String key, String tableName, const char * comment );
String GetLocalizedStringFromTableInBundle( String key, String tableName, Bundle bundle, const char * comment );
String GetLocalizedStringWithDefaultValue( String key, String tableName, String value, const char * comment );
Constructors of CF::Error
are ambiguous due to implicit casts to CF::String
from std::string
, CFTypeRef
, CFStringRef
, and const char *
.
Operators should call themselves whenever possible, in order to remove duplicate code.
Eg: CF::URL::operator = ( CFURLRef )
should simply call CF::URL::operator = ( CFTypeRef )
.
how to read/write plist file
"CoreFoundation is an powerfull C API, allowing object-oriented style coding in C, reference counting memory management, and providing a lot of useful classes."
Should be:
"CoreFoundation is a powerful C API which allows object-oriented style coding and reference counting memory management in C and provides a lot of useful classes."
Creates an iterator class for CF::ReadStream
(forward iterator) using CF::Data
.
As the function uses CFStringGetCStringPtr
, it may fails, depending on the encoding.
Thus, the operator is not reliable.
Finish unit tests for all CF++ classes, so planned features may be implemented safely.
Code coverage should ideally be around 95%.
Try to add support for CFIndex
in CF::Number
. Actual conversion is ambiguous.
According to the readme CF::Dictionary d3( 100 ); is valid for constructing a dictionary with an initial capacity. If I do this I get error Types CF::Dictionary and int are not compatible. As well, I don't see a constructor for int in the Dictionary header.
Add STL iterators for CF::Array
, CF::Dictionary
, and maybe CF::String
and CF::Data
.
Optimize CF::String::Iterator
using std::shared_ptr
in order to avoid copying the C string buffer in the copy constructor.
I can envision a factory function for CFPP types conceptually similar to CFBridgingRelease from ARC-enabled Objective-C. The purpose of which is to assign a CF object to a wrapper and release it. The most obvious benefit would be the ability to write code like CF::Array components = CFStringCreateArrayBySeparatingStrings(NULL, string, separator)
.
I'm planning on using CFPP in a project and I'm probably going to implement this functionality for that purpose. If you aren't opposed to the idea on principle I'd be happy to Pull Request it.
No big deal, but sqlite3_column_text returns const unsigned char *, would be a useful addition ;)
Add support for std::initializer_list
in CF::Array
, CF::Data
, and CF::Dictionary
.
Ensure comparison of floating point values are correct on CF::Number
.
When using this library it would be quite useful to be able to reference a specific version and know what snapshot of the code it represents.
I see milestones are already used for the roadmap items. It appears that all outstanding issues are marked for v0.3.0+. Could we tag current master as v0.2.0 for a reference point?
Invalid CF::Number
objects should be treated as zero.
Again, nice to parse blobs!
Consider the following example:
CF::Dictionary dic;
dic << CF::Pair( "Key", "Value" );
CF::String value = dic[ "Key" ]; //no problem.
bool contains = dic.ContainsKey( "Key" ); //crash
contains = dic.ContainsKey( CF::String( "Key" ) ); //OK.
CF::Pair's ctor accepts std::string. CF::Dictionary's subscript operator accepts std::string too. Wouldn't it make sense for ContainsKey to behave the same?
The following should not be valid:
CF::Dictionary d;
d = true;
Call is:
d.operator=( CF::Dictionary( ( CFIndex )true ) );
Use explicit constructors to fix the issue...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.