URL in C++

S

shaun roe

A specific question, a design question, and a possible idea:

1) Is there a good open source library in C++ which will allow me to
grab the contents of a URL to a string, or Xerces DOM document or...
whatever. (a sort of in-program 'curl' or wget ?)

2) I have a service which retrieves cabling for an experiment from a
(oracle or mysql) database. Except at the moment it doesnt, it retrieves
it from file.
I'd like it to **try to** retrieve from the database, and if it fails,
to rollover to retrieve-from-file behaviour.

I had thought to make an ICablingSvc interface with derived classes
OracleCabling, MySQLCabling, FileCabling (XMLCabling? URLCabling?).
One method would be ICabling.setRollover(ICabling * secondMethod),
allowing me to chain rollover behaviours in case of failure.

I'd like to be able to do the following:

OracleCabling dbCabling(OracleResource);
FileCabling localCabling(LocalFileResource);
dbCabling.setRollover(localCabling);
myCableMap=dbCabling.cableMap();


Question: is this a reasonable method?
Question: Is there some general way to specify the resource I want to
initialise the derived class with? e.g. a local file, or a DB
connection, or even an in-memory object?

3) Is there such a thing as a URL for a database connection, or
something in memory, or an XML DOMDocument which could act as a
completely general resource locator?

e.g. urls like

oracleDB://connectionstring
inMemory://pointerToLocation
xmlDocument://pointerToNode
 
S

shaun roe

Rapscallion said:

Thanks. A bit of Googling also showed me that there are already URLs
defined for a database connection, and I knew that it exists for a file.
How about for an in-memory object?

...and then I'll scout around for a URL class (probably already in
libcurl?) for my resource.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top