Esempio n. 1
0
File: EnvMgr.C Progetto: juddy/edcde
// fqlToFilePath()
//
// convert a fully qualified locator to the infolib's absolute path,
// as resolved during the load phase. This function is expecting only
// fully qualified forms which include the "INFOLIB=<path>" part, such
// as are returned by the UAS_Common method "locator()", and serves to
// extract the "path".
//
// Caution: An fql does not have to have the "INFOLIB=" part...
//          Could add insurance check for that here to be more robust.
//
UAS_String
EnvMgr::fqlToFilePath( UAS_String fulloc )
{
  UAS_String discard;

  fulloc.split ('=', discard, fulloc);
  fulloc.split ('&', fulloc, discard);
  return fulloc ;
}
Esempio n. 2
0
UAS_Pointer<UAS_Common>
UAS_Factory::create (const UAS_String &locator) {
    UAS_String access, rest;
    locator.split (':', access, rest);
    if (access == "") {
	throw (UAS_Exception((char*)UAS_String(
		CATGETS(Set_UAS_Base, 1,
			"No access part provided in locator (URL)."))));
    }
    UAS_Factory *theFactory = UAS_Factory::lookup(access);
    if (theFactory == 0) {
	char buf[BUFSIZ];
	(void) snprintf (buf, sizeof(buf), CATGETS(Set_UAS_Base, 2,
				     "Don't know how to create %s: objects"),
			(char*)access);

	throw (UAS_Exception(buf));
    }
    return theFactory->create_object (locator);
}