summaryrefslogtreecommitdiff
path: root/docs/git2/ODB.luadoc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/git2/ODB.luadoc')
-rw-r--r--docs/git2/ODB.luadoc159
1 files changed, 159 insertions, 0 deletions
diff --git a/docs/git2/ODB.luadoc b/docs/git2/ODB.luadoc
new file mode 100644
index 0000000..6e060ee
--- /dev/null
+++ b/docs/git2/ODB.luadoc
@@ -0,0 +1,159 @@
+--
+-- Warning: AUTOGENERATED DOCS.
+--
+
+--- Class "ODB".
+--
+module("ODB")
+
+--- Create a new ODB object.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_new">git_odb_new</a>:<p><p>Before the ODB can be used for read/writing, a custom database
+-- backend must be manually added using `git_odb_add_backend()`
+-- @return <a href="ODB.html">ODB</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB.new
+function ODB.new()
+end
+
+--- Create a new ODB object.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_open">git_odb_open</a>:<p><p>- git_odb_backend_loose: read and write loose object files
+-- from disk, assuming `objects_dir` as the Objects folder<p> - git_odb_backend_pack: read objects from packfiles,
+-- assuming `objects_dir` as the Objects folder which
+-- contains a 'pack/' folder with the corresponding data
+-- @param object_dir Must be of type <code>string</code>.
+-- @return <a href="ODB.html">ODB</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB.open
+function ODB.open(object_dir)
+end
+
+--- Destroy this object (will be called by Garbage Collector).
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_free">git_odb_free</a>:<p><p>
+-- @name ODB:free
+function ODB:free()
+end
+
+--- object method.
+--
+-- @param backend Must be of type <a href="ODBBackend.html">ODBBackend</a>.
+-- @param priority Must be of type <code>integer</code>.
+-- @return <code>true</code> if no error.
+-- @return Error string.
+-- @name ODB:add_backend
+function ODB:add_backend(backend, priority)
+end
+
+--- object method.
+--
+-- @param backend Must be of type <a href="ODBBackend.html">ODBBackend</a>.
+-- @param priority Must be of type <code>integer</code>.
+-- @return <code>true</code> if no error.
+-- @return Error string.
+-- @name ODB:add_alternate
+function ODB:add_alternate(backend, priority)
+end
+
+--- object method.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_read">git_odb_read</a>:<p><p>This method queries all available ODB backends
+-- trying to read the given OID.<p> The returned object is reference counted and
+-- internally cached, so it should be closed
+-- by the user once it's no longer in use.<p> @return
+-- - 0 if the object was read;
+-- - GIT_ENOTFOUND if the object is not in the database.
+-- @param id identity of the object to read.. Must be of type <a href="OID.html">OID</a>.
+-- @return <a href="OdbObject.html">OdbObject</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB:read
+function ODB:read(id)
+end
+
+--- object method.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_read_prefix">git_odb_read_prefix</a>:<p><p>This method queries all available ODB backends
+-- trying to match the 'len' first hexadecimal
+-- characters of the 'short_id'.
+-- The remaining (GIT_OID_HEXSZ-len)*4 bits of
+-- 'short_id' must be 0s.
+-- 'len' must be at least GIT_OID_MINPREFIXLEN,
+-- and the prefix must be long enough to identify
+-- a unique object in all the backends; the
+-- method will fail otherwise.<p> The returned object is reference counted and
+-- internally cached, so it should be closed
+-- by the user once it's no longer in use.
+-- @param short_id a prefix of the id of the object to read.. Must be of type <a href="OID.html">OID</a>.
+-- @param len the length of the prefix. Must be of type <code>integer</code>.
+-- @return <a href="OdbObject.html">OdbObject</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB:read_prefix
+function ODB:read_prefix(short_id, len)
+end
+
+--- object method.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_read_header">git_odb_read_header</a>:<p><p>The header includes the length and the type of an object.<p> Note that most backends do not support reading only the header
+-- of an object, so the whole object will be read and then the
+-- header will be returned.<p> @return
+-- - 0 if the object was read;
+-- - GIT_ENOTFOUND if the object is not in the database.
+-- @param id identity of the object to read.. Must be of type <a href="OID.html">OID</a>.
+-- @return <code>integer</code> or <code>nil</code> on error.
+-- @return <code>string</code> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB:read_header
+function ODB:read_header(id)
+end
+
+--- object method.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_exists">git_odb_exists</a>:<p><p>@return
+-- - 1, if the object was found
+-- - 0, otherwise
+-- @param id the object to search for.. Must be of type <a href="OID.html">OID</a>.
+-- @return <code>true</code> if no error.
+-- @return Error string.
+-- @name ODB:exists
+function ODB:exists(id)
+end
+
+--- object method.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_write">git_odb_write</a>:<p><p>This method writes a full object straight into the ODB.
+-- For most cases, it is preferred to write objects through a write
+-- stream, which is both faster and less memory intensive, specially
+-- for big objects.<p> This method is provided for compatibility with custom backends
+-- which are not able to support streaming writes
+-- @param data buffer with the data to storr. Must be of type <code>string</code>.
+-- @param type type of the data to store. Must be of type <code>string</code>.
+-- @return <a href="OID.html">OID</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB:write
+function ODB:write(data, type)
+end
+
+--- module function.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_hash">git_odb_hash</a>:<p><p>The resulting SHA-1 OID will the itentifier for the data
+-- buffer as if the data buffer it were to written to the ODB.
+-- @param data data to hash. Must be of type <code>string</code>.
+-- @param otype Must be of type <code>integer</code>.
+-- @return <a href="OID.html">OID</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB.hash
+function ODB.hash(data, otype)
+end
+
+--- module function.
+--
+-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/odb/git_odb_hashfile">git_odb_hashfile</a>:<p><p>
+-- @param path file to read and determine object id for. Must be of type <code>string</code>.
+-- @param otype Must be of type <code>integer</code>.
+-- @return <a href="OID.html">OID</a> or <code>nil</code> on error.
+-- @return Error string.
+-- @name ODB.hashfile
+function ODB.hashfile(path, otype)
+end
+