Skip to content

Instantly share code, notes, and snippets.

@macmade
Created March 8, 2014 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macmade/9434889 to your computer and use it in GitHub Desktop.
Save macmade/9434889 to your computer and use it in GitHub Desktop.
CoreFoundation++ Example
{
CF::Number number = 42;
CF::URL url = externalURL;
CF::Array array;
/* Adds number and URL to the array */
array << number << url;
CF::Data data
(
( CF::Data::Byte * )externalByteBuffer,
( CFIndex )externalByteBufferLength
);
CF::Dictionary dictionary;
/* Adds the two key/value pairs in the dictionary */
dictionary << CF::Pair( "key-1", data );
dictionary << CF::Pair( externalKey, data );
/* Prints the dictionary */
std::cout << dictionary << std::endl;
/* Nothing more, memory is automatically managed... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment