本文整理汇总了C#中Mem.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Mem.CopyTo方法的具体用法?C# Mem.CopyTo怎么用?C# Mem.CopyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mem
的用法示例。
在下文中一共展示了Mem.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sqlite3VdbeMemCopy
/*
** Make a full copy of pFrom into pTo. Prior contents of pTo are
** freed before the copy is made.
*/
private static int sqlite3VdbeMemCopy(Mem pTo, Mem pFrom)
{
int rc = SQLITE_OK;
Debug.Assert((pFrom.flags & MEM_RowSet) == 0);
sqlite3VdbeMemReleaseExternal(pTo);
pFrom.CopyTo(ref pTo);// memcpy(pTo, pFrom, MEMCELLSIZE);
pTo.flags = (u16)(pTo.flags & ~MEM_Dyn);
if ((pTo.flags & (MEM_Str | MEM_Blob)) != 0)
{
if (0 == (pFrom.flags & MEM_Static))
{
pTo.flags |= MEM_Ephem;
rc = sqlite3VdbeMemMakeWriteable(pTo);
}
}
return rc;
}
示例2: sqlite3VdbeMemMove
/*
** Transfer the contents of pFrom to pTo. Any existing value in pTo is
** freed. If pFrom contains ephemeral data, a copy is made.
**
** pFrom contains an SQL NULL when this routine returns.
*/
private static void sqlite3VdbeMemMove(Mem pTo, Mem pFrom)
{
Debug.Assert(pFrom.db == null || sqlite3_mutex_held(pFrom.db.mutex));
Debug.Assert(pTo.db == null || sqlite3_mutex_held(pTo.db.mutex));
Debug.Assert(pFrom.db == null || pTo.db == null || pFrom.db == pTo.db);
sqlite3VdbeMemRelease(pTo);
pFrom.CopyTo(ref pTo);// memcpy(pTo, pFrom, Mem).Length;
pFrom.flags = MEM_Null;
pFrom.xDel = null;
pFrom.z = null;
sqlite3_free(ref pFrom.zBLOB); //pFrom.zMalloc=0;
}
示例3: sqlite3VdbeMemShallowCopy
/*
** Size of struct Mem not including the Mem.zMalloc member.
*/
//#define MEMCELLSIZE (size_t)(&(((Mem *)0).zMalloc))
/*
** Make an shallow copy of pFrom into pTo. Prior contents of
** pTo are freed. The pFrom.z field is not duplicated. If
** pFrom.z is used, then pTo.z points to the same thing as pFrom.z
** and flags gets srcType (either MEM_Ephem or MEM_Static).
*/
private static void sqlite3VdbeMemShallowCopy(Mem pTo, Mem pFrom, int srcType)
{
Debug.Assert((pFrom.flags & MEM_RowSet) == 0);
sqlite3VdbeMemReleaseExternal(pTo);
pFrom.CopyTo(ref pTo);// memcpy(pTo, pFrom, MEMCELLSIZE);
pTo.xDel = null;
if ((pFrom.flags & MEM_Static) != 0)
{
pTo.flags = (u16)(pFrom.flags & ~(MEM_Dyn | MEM_Static | MEM_Ephem));
Debug.Assert(srcType == MEM_Ephem || srcType == MEM_Static);
pTo.flags |= (u16)srcType;
}
}