libmongo-client 0.1.4
src/sync-gridfs.h
Go to the documentation of this file.
00001 /* sync-gridfs.h - libmong-client GridFS API
00002  * Copyright 2011 Gergely Nagy <algernon@balabit.hu>
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00024 #ifndef LIBMONGO_SYNC_GRIDFS_H
00025 #define LIBMONGO_SYNC_GRIDFS_H 1
00026 
00027 #include <mongo-sync.h>
00028 #include <mongo-sync-cursor.h>
00029 #include <glib.h>
00030 
00031 G_BEGIN_DECLS
00032 
00050 typedef struct _mongo_sync_gridfs mongo_sync_gridfs;
00051 
00061 mongo_sync_gridfs *mongo_sync_gridfs_new (mongo_sync_connection *conn,
00062                                           const gchar *ns_prefix);
00063 
00070 void mongo_sync_gridfs_free (mongo_sync_gridfs *gfs, gboolean disconnect);
00071 
00078 gint32 mongo_sync_gridfs_get_chunk_size (mongo_sync_gridfs *gfs);
00079 
00087 gboolean mongo_sync_gridfs_set_chunk_size (mongo_sync_gridfs *gfs,
00088                                            gint32 chunk_size);
00089 
00103 mongo_sync_cursor *mongo_sync_gridfs_list (mongo_sync_gridfs *gfs,
00104                                            const bson *query);
00105 
00119 gboolean mongo_sync_gridfs_remove (mongo_sync_gridfs *gfs,
00120                                    const bson *query);
00121 
00122 /* Metadata */
00123 
00132 const guint8 *mongo_sync_gridfs_file_get_id (gpointer gfile);
00133 
00140 gint64 mongo_sync_gridfs_file_get_length (gpointer gfile);
00141 
00148 gint32 mongo_sync_gridfs_file_get_chunk_size (gpointer gfile);
00149 
00158 const gchar *mongo_sync_gridfs_file_get_md5 (gpointer gfile);
00159 
00166 gint64 mongo_sync_gridfs_file_get_date (gpointer gfile);
00167 
00177 const bson *mongo_sync_gridfs_file_get_metadata (gpointer gfile);
00178 
00185 gint64 mongo_sync_gridfs_file_get_chunks (gpointer gfile);
00186 
00189 G_END_DECLS
00190 
00193 #endif
 All Data Structures Files Functions Variables Enumerations Enumerator Defines