Building on the string code in the previous post, here is a simple Objective-C JSON parser that I use a lot.
Json.h, Json.m at GitHub.
Paul Senzee on iOS/Android App and Game Development, Technology and sometimes Life
Saturday, July 14, 2012
Friday, July 13, 2012
C String Library for C++ and Objective-C
In the last couple of years I've shifted professionally to iOS development. In doing so, I adapted some of my previous code for use with Objective-C.
I converted my super minimal C++ string library, consisting of basic string manipulation and parsing functions, back into pure C so that I could use it more conveniently with Objective-C as well as C++.
You can find strs_c.c, strs_c.h at GitHub.
It is intended to be very basic and small, so there's no regex or anything like that. There are string splitting and list handling functions, searching functions, trimming, parsing, etc. I have further libraries building on top of this for more sophisticated tasks. For example, an Objective-C JSON parsing library that I'll post right after this.
I converted my super minimal C++ string library, consisting of basic string manipulation and parsing functions, back into pure C so that I could use it more conveniently with Objective-C as well as C++.
You can find strs_c.c, strs_c.h at GitHub.
It is intended to be very basic and small, so there's no regex or anything like that. There are string splitting and list handling functions, searching functions, trimming, parsing, etc. I have further libraries building on top of this for more sophisticated tasks. For example, an Objective-C JSON parsing library that I'll post right after this.
Monday, June 25, 2012
Day of the Dead
“They opened the Altar of the Kings below the cathedral.”
“Kings of Mexico, ¿eh?”
Varela laughed. “Bishops, but there is an emperor buried under Mexico City's cathedral. There were emperors here from Europe long ago.”
The bus lodged in traffic before a saffron cathedral on the Avenue Heroes of the Cinco de Mayo. The driver pointed.
“Can you hear him?” Varela asked me.
I went to the front of the bus. “¿Mande?” I asked. What?
He pointed to a float covered with marigolds or zempazúchitls with a glass casket.
“San Francisco de Asís,” he said.
I smirked. “He's from Crusade times, ¿no?”
“You think it's not real, jóven?”
“Do you?”
“You are a niño, what do you know? He is preserved by a miracle.”
“Traffic's not moving so let's walk,” said Varela from behind and we disembarked and weaved among the cars.
“For Francis of Assisi!” Varela shouted, dodging a Volkswagen.
At the Cathedral of Puebla we followed a crowd that passed through a spoked mausoleum with tombs around a hub. “One of the bell towers is open,” a tourist said and we enqueued at the narrow spiral stairs.
From the lip of the colossal bronze campana, the crown of the carillon, you saw all the chapels of the city.
And down below, San Francisco wound his way through the Day of the Dead unfolding in candy colors, and you heard the ring of all the cathedrals interweave with a poetic tintinnabulation of the bells.
“Kings of Mexico, ¿eh?”
Varela laughed. “Bishops, but there is an emperor buried under Mexico City's cathedral. There were emperors here from Europe long ago.”
The bus lodged in traffic before a saffron cathedral on the Avenue Heroes of the Cinco de Mayo. The driver pointed.
“Can you hear him?” Varela asked me.
I went to the front of the bus. “¿Mande?” I asked. What?
He pointed to a float covered with marigolds or zempazúchitls with a glass casket.
“San Francisco de Asís,” he said.
I smirked. “He's from Crusade times, ¿no?”
“You think it's not real, jóven?”
“Do you?”
“You are a niño, what do you know? He is preserved by a miracle.”
“Traffic's not moving so let's walk,” said Varela from behind and we disembarked and weaved among the cars.
“For Francis of Assisi!” Varela shouted, dodging a Volkswagen.
At the Cathedral of Puebla we followed a crowd that passed through a spoked mausoleum with tombs around a hub. “One of the bell towers is open,” a tourist said and we enqueued at the narrow spiral stairs.
From the lip of the colossal bronze campana, the crown of the carillon, you saw all the chapels of the city.
And down below, San Francisco wound his way through the Day of the Dead unfolding in candy colors, and you heard the ring of all the cathedrals interweave with a poetic tintinnabulation of the bells.
Subscribe to:
Posts (Atom)