- std::string aNameDE = "DiscEdges";
- theResultBody->loadDisconnectedEdges(theGeomShape, aNameDE, aTag);
- std::string aNameDV = "DiscVertexes";
- theResultBody->loadDisconnectedVertexes(theGeomShape, aNameDV, aTag);
-}
-
-LibHandle ExchangePlugin_ImportFeature::loadImportPlugin(const std::string& theFormatName)
-{
- std::string aLibName = library(theFormatName + ID());
- LibHandle anImportLib = LoadLib(aLibName.c_str());
- std::string anImportError = "Failed to load " + aLibName + ": ";
- if(!anImportLib) {
-#ifdef WIN32
- LPVOID lpMsgBuf;
- ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- 0, ::GetLastError(), 0, (LPTSTR) &lpMsgBuf, 0, 0);
- anImportError = anImportError + std::string((char*) lpMsgBuf);
- ::LocalFree(lpMsgBuf);
-#else
- anImportError = anImportError + std::string(dlerror());
-#endif
- setError(anImportError);
- return false;
- }
- // Test loaded plugin for existence of valid "Import" function:
- importFunctionPointer fp = (importFunctionPointer) GetProc(anImportLib, "Import");
- if (!fp) {
- const static std::string aFunctionError =
- "No valid \"Import\" function was found in the " + aLibName;
- setError(aFunctionError);
- UnLoadLib(anImportLib)
- return NULL;
- }
- return anImportLib;