maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Google Protocol Buffers and C++ on Fremantle? (https://talk.maemo.org/showthread.php?t=98106)

jonwil 2016-11-03 05:57

Google Protocol Buffers and C++ on Fremantle?
 
Does anyone know of a way I can use Google Protocol Buffers .proto files with C++ on Maemo Fremantle on the N900? Presumably it would involve getting the protocol buffer compiler and libraries to build in Scratchbox and then getting the runtime libraries to work on the device (and then packaging the result up in the repos somewhere)

Specifically I am planning to work with Google GTFS-realtime data.

EDIT: It looks like there might be some protobuf stuff in extras but it looks to be old and un-maintained with no-one working on it anymore.

Halftux 2016-11-03 08:35

Re: Google Protocol Buffers and C++ on Fremantle?
 
Quote:

Originally Posted by jonwil (Post 1517946)
EDIT: It looks like there might be some protobuf stuff in extras but it looks to be old and un-maintained with no-one working on it anymore.

Yes it is in extras and not the latest version. It is also needed to compile the mosh shell. I tried to compile the latest mosh shell with the protobuf from extras and it was not complaining.
But anyway it would be nice to update protobuf.

jonwil 2016-11-03 11:17

Re: Google Protocol Buffers and C++ on Fremantle?
 
Looks like whats in the repos is suitable for compiling the GTFS-realtime .proto file anyway (that .proto file needs protobuf 2.x). So that's all good. Now I just need to find something that can parse the GTFS text files and I am good :)

Halftux 2016-11-03 12:43

Re: Google Protocol Buffers and C++ on Fremantle?
 
Have a look at stackoverflow. There is a python script which parsing GTFS-realtime.

jonwil 2016-11-03 13:23

Re: Google Protocol Buffers and C++ on Fremantle?
 
Parsing GTFS-realtime I can do now that I have been able to compile the protobuf file properly. What I have to find (or write) is something for parsing regular GTFS data (which is comma separated text files in a special format). All the code I can find with Google seems to be either for scripting languages or with web backend languages like Java. Can't seem to find anyone who has written GTFS parsing code in C or C++.

Halftux 2016-11-03 14:05

Re: Google Protocol Buffers and C++ on Fremantle?
 
Quote:

Originally Posted by jonwil (Post 1517960)
What I have to find (or write) is something for parsing regular GTFS data (which is comma separated text files in a special format).

Then it looks like you need to write a function on your own could not be so hard.

I don't know maybe that helps:

https://code.google.com/archive/p/gtfsengine/
https://developers.google.com/protoc...cs/cpptutorial

Or attach two files one with the initial data and one with the target format. I could write some function.

jonwil 2016-11-04 00:25

Re: Google Protocol Buffers and C++ on Fremantle?
 
I think writing my own makes sense, will be a fun exercise anyway :)
Although I did see something to convert GTFS data into a sqlite db, that might be a good place to start (since being in an sqlite db means I can write SQL to get the info I need)


All times are GMT. The time now is 09:24.

vBulletin® Version 3.8.8