您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sqlite3ValueText函数代码示例

51自学网 2021-06-03 08:14:38
  C++
这篇教程C++ sqlite3ValueText函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sqlite3ValueText函数的典型用法代码示例。如果您正苦于以下问题:C++ sqlite3ValueText函数的具体用法?C++ sqlite3ValueText怎么用?C++ sqlite3ValueText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sqlite3ValueText函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sqlite3_open16

/*** Open a new database handle.*/EXPORT_C int sqlite3_open16(  const void *zFilename,   sqlite3 **ppDb){  char const *zFilename8;   /* zFilename encoded in UTF-8 instead of UTF-16 */  sqlite3_value *pVal;  int rc = SQLITE_NOMEM;  assert( zFilename );  assert( ppDb );  *ppDb = 0;  pVal = sqlite3ValueNew(0);  sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);  zFilename8 = (const char*)sqlite3ValueText(pVal, SQLITE_UTF8);  if( zFilename8 ){    rc = openDatabase(zFilename8, ppDb,                      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);    if( rc==SQLITE_OK && *ppDb ){      rc = sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);      if( rc!=SQLITE_OK ){        sqlite3_close(*ppDb);        *ppDb = 0;      }    }  }  sqlite3ValueFree(pVal);  return sqlite3ApiExit(0, rc);}
开发者ID:guange2015,项目名称:sqlite-for-symbian,代码行数:32,


示例2: sqlite3ValueBytes

/*** Return the number of bytes in the sqlite3_value object assuming** that it uses the encoding "enc"*/int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc) {    Mem *p = (Mem*)pVal;    if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ) {        return p->n;    }    return 0;}
开发者ID:kanbang,项目名称:Colt,代码行数:11,


示例3: test_destructor

static void test_destructor(  sqlite3_context *pCtx,   int nArg,  sqlite3_value **argv){  char *zVal;  int len;  sqlite3 *db = sqlite3_user_data(pCtx);   test_destructor_count_var++;  assert( nArg==1 );  if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;  len = sqlite3ValueBytes(argv[0], ENC(db));   zVal = sqliteMalloc(len+3);  zVal[len] = 0;  zVal[len-1] = 0;  assert( zVal );  zVal++;  memcpy(zVal, sqlite3ValueText(argv[0], ENC(db)), len);  if( ENC(db)==SQLITE_UTF8 ){    sqlite3_result_text(pCtx, zVal, -1, destructor);#ifndef SQLITE_OMIT_UTF16  }else if( ENC(db)==SQLITE_UTF16LE ){    sqlite3_result_text16le(pCtx, zVal, -1, destructor);  }else{    sqlite3_result_text16be(pCtx, zVal, -1, destructor);#endif /* SQLITE_OMIT_UTF16 */  }}
开发者ID:f059074251,项目名称:interested,代码行数:29,


示例4: sqlite3ValueBytes

/*** Return the number of bytes in the sqlite3_value object assuming** that it uses the encoding "enc"*/int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){  Mem *p = (Mem*)pVal;  if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){    if( p->flags & MEM_Zero ){      return p->n + p->u.nZero;    }else{      return p->n;    }  }  return 0;}
开发者ID:HappyDanger,项目名称:sqlcipher,代码行数:15,


示例5: sqlite3_complete16

/*** This routine is the same as the sqlite3_complete() routine described** above, except that the parameter is required to be UTF-16 encoded, not** UTF-8.*/int sqlite3_complete16(const void *zSql){  sqlite3_value *pVal;  char const *zSql8;  int rc = 0;  pVal = sqlite3ValueNew();  sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);  zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);  if( zSql8 ){    rc = sqlite3_complete(zSql8);  }  sqlite3ValueFree(pVal);  return rc;}
开发者ID:DSD-TELCEL-ESCOM,项目名称:INE-Votation-Distributed-System,代码行数:19,


示例6: sqlite3_complete16

/*** This routine is the same as the sqlite3_complete() routine described** above, except that the parameter is required to be UTF-16 encoded, not** UTF-8.*/int sqlite3_complete16(const void *zSql){  sqlite3_value *pVal;  char const *zSql8;  int rc = SQLITE_NOMEM;#ifndef SQLITE_OMIT_AUTOINIT  rc = sqlite3_initialize();  if( rc ) return rc;#endif  pVal = sqlite3ValueNew(0);  sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);  zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);  if( zSql8 ){    rc = sqlite3_complete(zSql8);  }else{    rc = SQLITE_NOMEM;  }  sqlite3ValueFree(pVal);  return sqlite3ApiExit(0, rc);}
开发者ID:Farteen,项目名称:firefox-ios,代码行数:25,


示例7: callCollNeeded

/*** Invoke the 'collation needed' callback to request a collation sequence** in the database text encoding of name zName, length nName.** If the collation sequence*/static void callCollNeeded(sqlite3 *db, const char *zName, int nName){  assert( !db->xCollNeeded || !db->xCollNeeded16 );  if( nName<0 ) nName = strlen(zName);  if( db->xCollNeeded ){    char *zExternal = sqliteStrNDup(zName, nName);    if( !zExternal ) return;    db->xCollNeeded(db->pCollNeededArg, db, (int)db->enc, zExternal);    sqliteFree(zExternal);  }#ifndef SQLITE_OMIT_UTF16  if( db->xCollNeeded16 ){    char const *zExternal;    sqlite3_value *pTmp = sqlite3GetTransientValue(db);    sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);    zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);    if( !zExternal ) return;    db->xCollNeeded16(db->pCollNeededArg, db, (int)db->enc, zExternal);  }#endif}
开发者ID:DSD-TELCEL-ESCOM,项目名称:INE-Votation-Distributed-System,代码行数:25,


示例8: callCollNeeded

/*** Invoke the 'collation needed' callback to request a collation sequence** in the encoding enc of name zName, length nName.*/static void callCollNeeded(sqlite3 *db, int enc, const char *zName){  assert( !db->xCollNeeded || !db->xCollNeeded16 );  if( db->xCollNeeded ){    char *zExternal = sqlite3DbStrDup(db, zName);    if( !zExternal ) return;    db->xCollNeeded(db->pCollNeededArg, db, enc, zExternal);    sqlite3DbFree(db, zExternal);  }#ifndef SQLITE_OMIT_UTF16  if( db->xCollNeeded16 ){    char const *zExternal;    sqlite3_value *pTmp = sqlite3ValueNew(db);    sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);    zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);    if( zExternal ){      db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);    }    sqlite3ValueFree(pTmp);  }#endif}
开发者ID:cznic,项目名称:cc,代码行数:25,


示例9: sqlite3_prepare16

/*** Compile the UTF-16 encoded SQL statement zSql into a statement handle.*/int sqlite3_prepare16(  sqlite3 *db,              /* Database handle. */   const void *zSql,         /* UTF-8 encoded SQL statement. */  int nBytes,               /* Length of zSql in bytes. */  sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */  const void **pzTail       /* OUT: End of parsed string */){  /* This function currently works by first transforming the UTF-16  ** encoded string to UTF-8, then invoking sqlite3_prepare(). The  ** tricky bit is figuring out the pointer to return in *pzTail.  */  char const *zSql8 = 0;  char const *zTail8 = 0;  int rc;  sqlite3_value *pTmp;  if( sqlite3SafetyCheck(db) ){    return SQLITE_MISUSE;  }  pTmp = sqlite3GetTransientValue(db);  sqlite3ValueSetStr(pTmp, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);  zSql8 = sqlite3ValueText(pTmp, SQLITE_UTF8);  if( !zSql8 ){    sqlite3Error(db, SQLITE_NOMEM, 0);    return SQLITE_NOMEM;  }  rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8);  if( zTail8 && pzTail ){    /* If sqlite3_prepare returns a tail pointer, we calculate the    ** equivalent pointer into the UTF-16 string by counting the unicode    ** characters between zSql8 and zTail8, and then returning a pointer    ** the same number of characters into the UTF-16 string.    */    int chars_parsed = sqlite3utf8CharLen(zSql8, zTail8-zSql8);    *pzTail = (u8 *)zSql + sqlite3utf16ByteLen(zSql, chars_parsed);  }   return rc;}
开发者ID:DSD-TELCEL-ESCOM,项目名称:INE-Votation-Distributed-System,代码行数:43,


示例10: sqlite3ValueText

const void *sqlite3_value_text16le(sqlite3_value *pVal){  return sqlite3ValueText(pVal, SQLITE_UTF16LE);}
开发者ID:Farteen,项目名称:firefox-ios,代码行数:3,


示例11: return

const unsigned char *sqlite3_value_text(sqlite3_value *pVal){  return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);}
开发者ID:Farteen,项目名称:firefox-ios,代码行数:3,


示例12: sqlite3MemCompare

/*** Compare the values contained by the two memory cells, returning** negative, zero or positive if pMem1 is less than, equal to, or greater** than pMem2. Sorting order is NULL's first, followed by numbers (integers** and reals) sorted numerically, followed by text ordered by the collating** sequence pColl and finally blob's ordered by memcmp().**** Two NULL values are considered equal by this function.*/int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl) {    int rc;    int f1, f2;    int combined_flags;    /* Interchange pMem1 and pMem2 if the collating sequence specifies    ** DESC order.    */    f1 = pMem1->flags;    f2 = pMem2->flags;    combined_flags = f1|f2;    /* If one value is NULL, it is less than the other. If both values    ** are NULL, return 0.    */    if( combined_flags&MEM_Null ) {        return (f2&MEM_Null) - (f1&MEM_Null);    }    /* If one value is a number and the other is not, the number is less.    ** If both are numbers, compare as reals if one is a real, or as integers    ** if both values are integers.    */    if( combined_flags&(MEM_Int|MEM_Real) ) {        if( !(f1&(MEM_Int|MEM_Real)) ) {            return 1;        }        if( !(f2&(MEM_Int|MEM_Real)) ) {            return -1;        }        if( (f1 & f2 & MEM_Int)==0 ) {            double r1, r2;            if( (f1&MEM_Real)==0 ) {                r1 = pMem1->i;            } else {                r1 = pMem1->r;            }            if( (f2&MEM_Real)==0 ) {                r2 = pMem2->i;            } else {                r2 = pMem2->r;            }            if( r1<r2 ) return -1;            if( r1>r2 ) return 1;            return 0;        } else {            assert( f1&MEM_Int );            assert( f2&MEM_Int );            if( pMem1->i < pMem2->i ) return -1;            if( pMem1->i > pMem2->i ) return 1;            return 0;        }    }    /* If one value is a string and the other is a blob, the string is less.    ** If both are strings, compare using the collating functions.    */    if( combined_flags&MEM_Str ) {        if( (f1 & MEM_Str)==0 ) {            return 1;        }        if( (f2 & MEM_Str)==0 ) {            return -1;        }        assert( pMem1->enc==pMem2->enc );        assert( pMem1->enc==SQLITE_UTF8 ||                pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );        /* This assert may fail if the collation sequence is deleted after this        ** vdbe program is compiled. The documentation defines this as an        ** undefined condition. A crash is usual result.        */        assert( !pColl || pColl->xCmp );        if( pColl ) {            if( pMem1->enc==pColl->enc ) {                return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z);            } else {                u8 origEnc = pMem1->enc;                rc = pColl->xCmp(                         pColl->pUser,                         sqlite3ValueBytes((sqlite3_value*)pMem1, pColl->enc),                         sqlite3ValueText((sqlite3_value*)pMem1, pColl->enc),                         sqlite3ValueBytes((sqlite3_value*)pMem2, pColl->enc),                         sqlite3ValueText((sqlite3_value*)pMem2, pColl->enc)                     );                sqlite3ValueBytes((sqlite3_value*)pMem1, origEnc);                sqlite3ValueText((sqlite3_value*)pMem1, origEnc);                sqlite3ValueBytes((sqlite3_value*)pMem2, origEnc);                sqlite3ValueText((sqlite3_value*)pMem2, origEnc);//.........这里部分代码省略.........
开发者ID:kanbang,项目名称:Colt,代码行数:101,


示例13: sqlite3MemCompare

/*** Compare the values contained by the two memory cells, returning** negative, zero or positive if pMem1 is less than, equal to, or greater** than pMem2. Sorting order is NULL's first, followed by numbers (integers** and reals) sorted numerically, followed by text ordered by the collating** sequence pColl and finally blob's ordered by memcmp().**** Two NULL values are considered equal by this function.*/int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){  int rc;  int f1, f2;  int combined_flags;  /* Interchange pMem1 and pMem2 if the collating sequence specifies  ** DESC order.  */  f1 = pMem1->flags;  f2 = pMem2->flags;  combined_flags = f1|f2;   /* If one value is NULL, it is less than the other. If both values  ** are NULL, return 0.  */  if( combined_flags&MEM_Null ){    return (f2&MEM_Null) - (f1&MEM_Null);  }  /* If one value is a number and the other is not, the number is less.  ** If both are numbers, compare as reals if one is a real, or as integers  ** if both values are integers.  */  if( combined_flags&(MEM_Int|MEM_Real) ){    if( !(f1&(MEM_Int|MEM_Real)) ){      return 1;    }    if( !(f2&(MEM_Int|MEM_Real)) ){      return -1;    }    if( (f1 & f2 & MEM_Int)==0 ){      double r1, r2;      if( (f1&MEM_Real)==0 ){        r1 = pMem1->u.i;      }else{        r1 = pMem1->r;      }      if( (f2&MEM_Real)==0 ){        r2 = pMem2->u.i;      }else{        r2 = pMem2->r;      }      if( r1<r2 ) return -1;      if( r1>r2 ) return 1;      return 0;    }else{      assert( f1&MEM_Int );      assert( f2&MEM_Int );      if( pMem1->u.i < pMem2->u.i ) return -1;      if( pMem1->u.i > pMem2->u.i ) return 1;      return 0;    }  }  /* If one value is a string and the other is a blob, the string is less.  ** If both are strings, compare using the collating functions.  */  if( combined_flags&MEM_Str ){    if( (f1 & MEM_Str)==0 ){      return 1;    }    if( (f2 & MEM_Str)==0 ){      return -1;    }    assert( pMem1->enc==pMem2->enc );    assert( pMem1->enc==SQLITE_UTF8 ||             pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );    /* The collation sequence must be defined at this point, even if    ** the user deletes the collation sequence after the vdbe program is    ** compiled (this was not always the case).    */    assert( !pColl || pColl->xCmp );    if( pColl ){      if( pMem1->enc==pColl->enc ){        /* The strings are already in the correct encoding.  Call the        ** comparison function directly */        return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z);      }else{        const void *v1, *v2;        int n1, n2;        Mem c1;        Mem c2;        memset(&c1, 0, sizeof(c1));        memset(&c2, 0, sizeof(c2));        sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);        sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);        v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);        n1 = v1==0 ? 0 : c1.n;//.........这里部分代码省略.........
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:101,


示例14: sqlite3ValueText

SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){    return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);}
开发者ID:pchernev,项目名称:Objective-C-iOS-Categories,代码行数:3,



注:本文中的sqlite3ValueText函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sqlite3VdbeAddOp函数代码示例
C++ sqlite3ValueSetStr函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。