-
-
Save macmade/9434889 to your computer and use it in GitHub Desktop.
CoreFoundation++ Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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