예제 #1
0
	/** Like the other uploadByHash() function, but computes the hash.
	 *
	 * @param hashContext  The URIContext to upload the hash to (e.g. "mhash:")
	 */
	inline void uploadByHash(const URIContext &hashContext,
			const DenseDataPtr &toUpload,
			const EventListener &listener) {
		RemoteFileId rfid(
			Fingerprint::computeDigest(toUpload->data(), toUpload->length()),
			hashContext);
		uploadByHash(rfid, toUpload, listener);
	}
예제 #2
0
	/** Uploads a filename, and if necessary, uploads the data as well.
	 *
	 * @param name         The named file to be uploaded (of the form "meerkat:///somefile.texture")
	 * @param hashContext  The location to upload the data to (usually "mhash:")
	 * @param toUpload     Data to be uploaded. Will only be uploaded if necessary.
	 * @param listener     An EventListener to receive a UploadEventPtr with the retrieved data.
	 * @param forceIfExists Upload the data even if the file already exists on all known CDN services.
	 */
	inline void upload(const URI &name,
			const URIContext &hashContext,
			const DenseDataPtr &toUpload,
			const EventListener &listener,
			bool forceIfExists) {
		RemoteFileId rfid(
			Fingerprint::computeDigest(toUpload->data(), toUpload->length()),
			hashContext);
		upload(name, rfid, toUpload, listener, forceIfExists);
	}