//virtual axStatus axDBConn_MySQL::getSQL_CreateTable ( axStringA_Array & outSQLArray, const axDBColumnList & list, const char* table ) { axStatus st; axTempStringA tableName; st = outSQLArray.resize(1); if( !st ) return st; axIStringA & outSQL = outSQLArray[0]; st = identifierString( tableName, table ); if( !st ) return st; st = outSQL.format("CREATE TABLE {?} (\n", tableName ); if( !st ) return st; axTempStringA colName; for( size_t i=0; i<list.size(); i++ ) { const axDBColumn & c = list[i]; if( i > 0 ) { st = outSQL.append(",\n"); if( !st ) return st; } st = identifierString( colName, c.name ); if( !st ) return st; st = outSQL.appendFormat( " {?}\t{?}", colName, DBTypeName(c.type) ); if( !st ) return st; if( list.pkeyIndex() == i ) { st = outSQL.append( " PRIMARY KEY" ); if( !st ) return st; if( list.pkeyAutoInc() ) { st = outSQL.append( " AUTO_INCREMENT" ); if( !st ) return st; } } } st = outSQL.appendFormat( "\n);" ); if( !st ) return st; return 0; }
void FrameLoaderClient::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long identifier) { static_cast<WebKit::DocumentLoader*>(loader)->decreaseLoadCount(identifier); WebKitWebView* webView = getViewFromFrame(m_frame); GOwnPtr<gchar> identifierString(toString(identifier)); WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get()); // A NULL WebResource means the load has been interrupted, and // replaced by another one while this resource was being loaded. if (!webResource) return; const char* uri = webkit_web_resource_get_uri(webResource); RefPtr<ArchiveResource> coreResource(loader->subresource(KURL(KURL(), uri))); // If coreResource is NULL here, the resource failed to load, // unless it's the main resource. if (!coreResource && webResource != webkit_web_view_get_main_resource(webView)) return; if (!coreResource) coreResource = loader->mainResource().releaseRef(); webkit_web_resource_init_with_core_resource(webResource, coreResource.get()); // FIXME: This function should notify the application that the resource // finished loading, maybe using a load-status property in the // WebKitWebResource object, similar to what we do for WebKitWebFrame' // signal. notImplemented(); }
void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) { GOwnPtr<WebKitNetworkResponse> networkResponse(0); // We are adding one more resource to the load, or maybe we are // just redirecting a load. if (redirectResponse.isNull()) static_cast<WebKit::DocumentLoader*>(loader)->increaseLoadCount(identifier); else networkResponse.set(webkit_network_response_new_with_core_response(redirectResponse)); WebKitWebView* webView = getViewFromFrame(m_frame); GOwnPtr<gchar> identifierString(toString(identifier)); WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get()); GOwnPtr<WebKitNetworkRequest> networkRequest(webkit_network_request_new_with_core_request(request)); if (!redirectResponse.isNull()) { // This is a redirect, so we need to update the WebResource's knowledge // of the URI. g_free(webResource->priv->uri); webResource->priv->uri = g_strdup(request.url().string().utf8().data()); } g_signal_emit_by_name(webView, "resource-request-starting", m_frame, webResource, networkRequest.get(), networkResponse.get()); // Feed any changes back into the ResourceRequest object. SoupMessage* message = webkit_network_request_get_message(networkRequest.get()); if (!message) { request.setURL(KURL(KURL(), String::fromUTF8(webkit_network_request_get_uri(networkRequest.get())))); return; } request.updateFromSoupMessage(message); }
axStatus axDBConn_MySQL::releaseSavePoint ( const char* name ) { axStatus st; axTempStringA tmp; axStringA_<64> spName; st = identifierString( spName, name ); if( !st ) return st; st = tmp.format("RELEASE SAVEPOINT {?};", spName); if( !st ) return st; return _directExec( tmp ); }
void FrameLoaderClient::transferLoadingResourceFromPage(WebCore::ResourceLoader* loader, const WebCore::ResourceRequest& request, WebCore::Page* oldPage) { ASSERT(oldPage != core(m_frame)->page()); GOwnPtr<gchar> identifierString(toString(loader->identifier())); ASSERT(!webkit_web_view_get_resource(getViewFromFrame(m_frame), identifierString.get())); assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request); webkit_web_view_remove_resource(kit(oldPage), identifierString.get()); }
UaString UaNodeId::toString() const { if (identifierType() == IdentifierType::OpcUa_IdentifierType_String) { return identifierString(); } else if (identifierType() == IdentifierType::OpcUa_IdentifierType_Numeric) { std::string s = "(ns="+boost::lexical_cast<std::string>(namespaceIndex())+","+boost::lexical_cast<std::string>(identifierNumeric())+")"; return UaString(s.c_str()); } return "identifier-type-unsupported"; }
void FrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const ResourceRequest& request) { GOwnPtr<gchar> identifierString(toString(identifier)); WebKitWebResource* webResource = WEBKIT_WEB_RESOURCE(g_object_new(WEBKIT_TYPE_WEB_RESOURCE, "uri", request.url().string().utf8().data(), 0)); if (loader == loader->frameLoader()->provisionalDocumentLoader() && loader->frameLoader()->isLoadingMainFrame()) { webkit_web_view_add_main_resource(getViewFromFrame(m_frame), identifierString.get(), webResource); return; } webkit_web_view_add_resource(getViewFromFrame(m_frame), identifierString.get(), webResource); }
UaString UaNodeId::toFullString() const { if (identifierType() == IdentifierType::OpcUa_IdentifierType_String) { std::string s = "(ns="+boost::lexical_cast<std::string>(namespaceIndex())+","+UaString(identifierString()).toUtf8()+")"; return UaString(s.c_str()); } else return toString(); }