コード例 #1
0
ファイル: aRTdb.cpp プロジェクト: pedro-andrade-inpe/aRT-old
SEXP aRTdb::Summary()
{
    SEXP info, names;

    info = allocVector(VECSXP, aRTdbSSum); // List containing the connection attributes
    names = allocVector(STRSXP, aRTdbSSum); // Names Vector

    STRING_LIST_ITEM(info, names, aRTdbSClass,     "class",    Class());
	STRING_LIST_ITEM(info, names, aRTdbSDatabase,  "database", Database->databaseName());

	SEXP_LIST_ITEM(info, names, aRTdbSThemes, "themes", ShowThemes());
    SEXP_LIST_ITEM(info, names, aRTdbSViews,  "views",  ShowViews());
    SEXP_LIST_ITEM(info, names, aRTdbSLayers, "layers", List());
	
    setAttrib(info, R_NamesSymbol, names); // Set the names of the list

    return info;
}
コード例 #2
0
STDMETHODIMP CWebSite::LoadDocument(BSTR pathName, BOOL *success)
{
	ATLASSERT(m_pRootDir == NULL);

//
	CComQIPtr<IDOMDocument> document;
	document.CoCreateInstance(CLSID_DOMDocument);

	VARIANT_BOOL bsuccess;
	document->load(pathName, &bsuccess);
	if (bsuccess)
	{
		char dir[_MAX_PATH];
		char path[_MAX_PATH];
		char filename[_MAX_PATH];
		char ext[_MAX_PATH];
		_splitpath(_bstr_t(pathName), dir, path, filename, ext);

		TCHAR mdbfullpathname[260];
		_makepath(mdbfullpathname, dir, path, "site_data", "mdb");

		TCHAR rootpath[_MAX_PATH];
		_makepath(rootpath, dir, path, "root", NULL);

		m_rootPath = rootpath;

		// Open website database data
		if (m_siteDataConnection == NULL)
		{
			try
			{
				swprintf(m_connstr, L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%S", mdbfullpathname);

				m_siteDataConnection.CreateInstance(__uuidof(ADODB::Connection));
				m_siteDataConnection->Open(m_connstr, "", "", ADODB::adConnectUnspecified);
			}
			catch (_com_error &e)
			{
				DbError(e);
			}
		}

		GetHomepageFileIdFromDB();	// ReadSettings

		m_pRootDir = new CSiteDir;
		m_pRootDir->m_pWebSite = this;
		m_pRootDir->m_pathName = CUString((BSTR)m_rootPath);

		m_pRootDir->BuildFromDatabase();
		m_pRootDir->ScanFiles(TRUE, FALSE);

	//	m_pRootDir->UpdateOutLinks();

		CComQIPtr<IWebSite> site = this;

		m_hChangeThread = CreateThread(NULL, 0, ChangeNotifyThread, site.p, 0, &m_dwChangeThreadID);

	// TODO Fire UI Update event

		ShowViews();
	}

	return S_OK;
}