当前位置: 首页>>代码示例>>C++>>正文


C++ GWEN_Buffer_AppendString函数代码示例

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


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

示例1: GWEN_Buffer_AppendString

GWEN_DIALOG *Dlg_Test1_new() {
    GWEN_DIALOG *dlg;
    int rv;
    const char *s;
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    s=getenv("DIALOG_DIR");
    if (s && *s)
        GWEN_Buffer_AppendString(tbuf, s);
    else
        GWEN_Buffer_AppendString(tbuf, MEDIAPATH);
    dlg=GWEN_Dialog_new("dlg_test");
    GWEN_Dialog_SetSignalHandler(dlg, _gwenGuiSignalHandler);
    GWEN_Dialog_AddMediaPath(dlg, GWEN_Buffer_GetStart(tbuf));

    /* read dialog from dialog description file */
    GWEN_Buffer_AppendString(tbuf, GWEN_DIR_SEPARATOR_S "dlg_test.dlg");
    rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(tbuf));
    GWEN_Buffer_free(tbuf);
    if (rv<0) {
        DBG_INFO(GWEN_LOGDOMAIN, "here (%d).", rv);
        GWEN_Dialog_free(dlg);
        return NULL;
    }

    /* done */
    return dlg;
}
开发者ID:Zauberstuhl,项目名称:gwenhywfar,代码行数:29,代码来源:dlg_test.c

示例2: AB_Banking_GetSharedDataDir

int AB_Banking_GetSharedDataDir(const AB_BANKING *ab,
                                const char *name,
                                GWEN_BUFFER *buf){
  assert(ab);
  if (ab->dataDir) {
    GWEN_Buffer_AppendString(buf, ab->dataDir);
    GWEN_Buffer_AppendString(buf, DIRSEP "shared" DIRSEP);
    if (GWEN_Text_EscapeToBufferTolerant(name, buf)) {
      DBG_ERROR(AQBANKING_LOGDOMAIN,
		"Bad share name, aborting.");
      abort();
    }
    else {
      char *s;
  
      s=GWEN_Buffer_GetStart(buf);
      while(*s) {
	*s=tolower(*s);
	s++;
      }
    }
    return 0;
  }
  else {
    DBG_ERROR(AQBANKING_LOGDOMAIN, "No data dir (not init?)");
    return GWEN_ERROR_GENERIC;
  }
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:28,代码来源:banking_cfg.c

示例3: AH_User_AddTextWithoutTags

int AH_User_AddTextWithoutTags(const char *s, GWEN_BUFFER *obuf) {
  while(*s) {
    if (*s=='<') {
      const char *s2;
      int l;

      s2=s;
      s2++;
      while(*s2 && *s2!='>')
	s2++;
      l=s2-s-2;
      if (l>0) {
	const char *s3;

	s3=s;
	s3++;
	if (l==2) {
	  if (strncasecmp(s3, "br", 2)==0)
	    GWEN_Buffer_AppendString(obuf, "\n");
	}
	else if (l==3) {
	  if (strncasecmp(s3, "br/", 3)==0)
	    GWEN_Buffer_AppendString(obuf, "\n");
	}
      }
      s=s2; /* set s to position of closing bracket */
    }
    else
      GWEN_Buffer_AppendByte(obuf, *s);
    /* next char */
    s++;
  }

  return 0;
}
开发者ID:maduhu,项目名称:aqbanking-1,代码行数:35,代码来源:user.c

示例4: AB_Value_toHumanReadableString2

void AB_Value_toHumanReadableString2(const AB_VALUE *v,
				     GWEN_BUFFER *buf,
				     int prec,
				     int withCurrency) {
  char numbuf[128];
  double num;
  int rv;
#ifdef HAVE_SETLOCALE
  const char *orig_locale = setlocale(LC_NUMERIC, NULL);
  char *currentLocale = strdup(orig_locale ? orig_locale : "C");
  setlocale(LC_NUMERIC, "C");
#endif

  num=AB_Value_GetValueAsDouble(v);
  rv=snprintf(numbuf, sizeof(numbuf), "%.*f",
	      prec, num);

#ifdef HAVE_SETLOCALE
  setlocale(LC_NUMERIC, currentLocale);
  free(currentLocale);
#endif

  if (rv<1 || rv>=sizeof(numbuf)) {
    assert(0);
  }
  GWEN_Buffer_AppendString(buf, numbuf);

  if (v->currency && withCurrency) {
    GWEN_Buffer_AppendString(buf, " ");
    GWEN_Buffer_AppendString(buf, v->currency);
  }
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:32,代码来源:value.c

示例5: AH_NewKeyFileDialog_HandleActivatedIniLetter

static int AH_NewKeyFileDialog_HandleActivatedIniLetter(GWEN_DIALOG *dlg) {
  AH_NEWKEYFILE_DIALOG *xdlg;
  int rv;
  GWEN_BUFFER *tbuf;


  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg);
  assert(xdlg);

  tbuf=GWEN_Buffer_new(0, 1024, 0, 1);

  /* add HTML version of the INI letter */
  GWEN_Buffer_AppendString(tbuf, "<html>");
  rv=AH_Provider_GetIniLetterHtml(AB_User_GetProvider(xdlg->user),
				  xdlg->user,
				  0,
				  0,
				  tbuf,
				  1);
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d)", rv);
    // TODO: show error message
    AB_Banking_ClearCryptTokenList(xdlg->banking);
    GWEN_Buffer_free(tbuf);
    return GWEN_DialogEvent_ResultHandled;
  }
  GWEN_Buffer_AppendString(tbuf, "</html>");


  /* add ASCII version of the INI letter for frontends which don't support HTML */
  rv=AH_Provider_GetIniLetterTxt(AB_User_GetProvider(xdlg->user),
				 xdlg->user,
				 0,
				 0,
				 tbuf,
				 0);
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d)", rv);
    // TODO: show error message
    AB_Banking_ClearCryptTokenList(xdlg->banking);
    GWEN_Buffer_free(tbuf);
    return GWEN_DialogEvent_ResultHandled;
  }

  rv=GWEN_Gui_Print(I18N("INI Letter"),
		    "HBCI-INILETTER",
		    I18N("INI Letter for HBCI"),
		    GWEN_Buffer_GetStart(tbuf),
		    0);
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d)", rv);
    // TODO: show error message
    GWEN_Buffer_free(tbuf);
    return GWEN_DialogEvent_ResultHandled;
  }

  GWEN_Buffer_free(tbuf);
  return GWEN_DialogEvent_ResultHandled;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:60,代码来源:dlg_newkeyfile.c

示例6: GWEN_Directory_FindPathForFile

int GWEN_Directory_FindPathForFile(const GWEN_STRINGLIST *paths,
                                   const char *filePath,
                                   GWEN_BUFFER *fbuf) {
  GWEN_STRINGLISTENTRY *se;

  se=GWEN_StringList_FirstEntry(paths);
  while(se) {
    GWEN_BUFFER *tbuf;
    FILE *f;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    GWEN_Buffer_AppendString(tbuf, GWEN_StringListEntry_Data(se));
    GWEN_Buffer_AppendString(tbuf, DIRSEP);
    GWEN_Buffer_AppendString(tbuf, filePath);
    DBG_VERBOUS(GWEN_LOGDOMAIN, "Trying \"%s\"",
                GWEN_Buffer_GetStart(tbuf));
    f=fopen(GWEN_Buffer_GetStart(tbuf), "r");
    if (f) {
      fclose(f);
      DBG_INFO(GWEN_LOGDOMAIN,
               "File \"%s\" found in folder \"%s\"",
               filePath,
               GWEN_StringListEntry_Data(se));
      GWEN_Buffer_AppendString(fbuf, GWEN_StringListEntry_Data(se));
      GWEN_Buffer_free(tbuf);
      return 0;
    }
    GWEN_Buffer_free(tbuf);

    se=GWEN_StringListEntry_Next(se);
  }

  DBG_INFO(GWEN_LOGDOMAIN, "File \"%s\" not found", filePath);
  return GWEN_ERROR_NOT_FOUND;
}
开发者ID:aqbanking,项目名称:gwenhywfar,代码行数:35,代码来源:directory_all.c

示例7: GWEN_Buffer_AppendString

GWEN_TIME *AB_ImExporter_DateFromString(const char *p, const char *tmpl,
					int inUtc) {
  GWEN_TIME *ti;

  if (strchr(tmpl, 'h')==0) {
    GWEN_BUFFER *dbuf;
    GWEN_BUFFER *tbuf;

    dbuf=GWEN_Buffer_new(0, 32, 0, 1);
    GWEN_Buffer_AppendString(dbuf, p);
    GWEN_Buffer_AppendString(dbuf, "-12:00");

    tbuf=GWEN_Buffer_new(0, 32, 0, 1);
    GWEN_Buffer_AppendString(tbuf, tmpl);
    GWEN_Buffer_AppendString(tbuf, "-hh:mm");

    ti=GWEN_Time_fromUtcString(GWEN_Buffer_GetStart(dbuf),
			       GWEN_Buffer_GetStart(tbuf));
    GWEN_Buffer_free(tbuf);
    GWEN_Buffer_free(dbuf);
  }
  else {
    if (inUtc)
      ti=GWEN_Time_fromUtcString(p, tmpl);
    else
      ti=GWEN_Time_fromString(p, tmpl);
  }
  return ti;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:29,代码来源:imexporter.c

示例8: GWEN_Url_toCommandString

int GWEN_Url_toCommandString(const GWEN_URL *url, GWEN_BUFFER *buf) {
  GWEN_DB_NODE *dbV;

  assert(url);

  if (url->path) {
    GWEN_Buffer_AppendString(buf, url->path);
  }
  if (url->vars) {
    dbV=GWEN_DB_GetFirstVar(url->vars);
    while(dbV) {
      const char *s;

      s=GWEN_DB_VariableName(dbV);
      if (s) {
        GWEN_DB_NODE *dbVal;

        GWEN_Buffer_AppendString(buf, "?");
        GWEN_Buffer_AppendString(buf, s);
        dbVal=GWEN_DB_GetFirstValue(dbV);
        if (dbVal) {
          s=GWEN_DB_GetCharValueFromNode(dbVal);
          if (s) {
            GWEN_Buffer_AppendString(buf, "=");
            GWEN_Buffer_AppendString(buf, s);
          }
        }
      }
      dbV=GWEN_DB_GetNextVar(dbV);
    }
  }

  return 0;
}
开发者ID:kleopatra999,项目名称:gwenhywfar,代码行数:34,代码来源:urlfns.c

示例9: GWEN_PathManager_FindFile

int GWEN_PathManager_FindFile(const char *destLib,
                              const char *pathName,
                              const char *fileName,
                              GWEN_BUFFER *fbuf) {
  GWEN_DB_NODE *dbT;

  assert(gwen__paths);
  dbT=GWEN_DB_GetGroup(gwen__paths, GWEN_PATH_FLAGS_NAMEMUSTEXIST,
                       destLib);
  if (dbT) {
    dbT=GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST,
                         pathName);
    if (dbT) {
      int i;
      const char *s;
      GWEN_DB_NODE *dbN;
      GWEN_BUFFER *tbuf;

      tbuf=GWEN_Buffer_new(0, 256, 0, 1);

      /* check all paths */
      dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
      while(dbN) {
        for (i=0; ; i++) {
          s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
          if (!s)
            break;
          else {
            FILE *f;

            GWEN_Buffer_AppendString(tbuf, s);
            GWEN_Buffer_AppendString(tbuf, GWEN_DIR_SEPARATOR_S);
            GWEN_Buffer_AppendString(tbuf, fileName);
            DBG_DEBUG(GWEN_LOGDOMAIN, "Trying \"%s\"",
                      GWEN_Buffer_GetStart(tbuf));
            f=fopen(GWEN_Buffer_GetStart(tbuf), "r");
            if (f) {
              fclose(f);
              DBG_DEBUG(GWEN_LOGDOMAIN,
                        "File \"%s\" found in folder \"%s\"",
                        fileName,
                        s);
              GWEN_Buffer_AppendBuffer(fbuf, tbuf);
              GWEN_Buffer_free(tbuf);
              return 0;
            }
            GWEN_Buffer_Reset(tbuf);
          }
        }

        dbN=GWEN_DB_FindNextGroup(dbN, "pair");
      }
      GWEN_Buffer_free(tbuf);
    }
  }

  DBG_INFO(GWEN_LOGDOMAIN, "File \"%s\" not found", fileName);
  return GWEN_ERROR_NOT_FOUND;
}
开发者ID:Zauberstuhl,项目名称:gwenhywfar,代码行数:59,代码来源:pathmanager.c

示例10: AB_Value_toString

void AB_Value_toString(const AB_VALUE *v, GWEN_BUFFER *buf) {
  assert(v);
  AB_Value__toString(v, buf);
  if (v->currency) {
    GWEN_Buffer_AppendString(buf, ":");
    GWEN_Buffer_AppendString(buf, v->currency);
  }
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:8,代码来源:value.c

示例11: AB_Banking_GetProviderUserDataDir

int AB_Banking_GetProviderUserDataDir(const AB_BANKING *ab,
				      const char *name,
				      GWEN_BUFFER *buf){
  int rv;

  rv=AB_Banking_GetUserDataDir(ab, buf);
  if (rv)
    return rv;
  GWEN_Buffer_AppendString(buf, DIRSEP "backends" DIRSEP);
  GWEN_Buffer_AppendString(buf, name);
  GWEN_Buffer_AppendString(buf, DIRSEP "data");
  return 0;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:13,代码来源:banking_cfg.c

示例12: LC_Client_GetReaderAndDriverType

int LC_Client_GetReaderAndDriverType(const LC_CLIENT *cl,
				     const char *readerName,
				     GWEN_BUFFER *driverType,
				     GWEN_BUFFER *readerType,
				     uint32_t *pReaderFlags) {
  GWEN_DB_NODE *dbDriver;

  dbDriver=GWEN_DB_FindFirstGroup(lc_client__driver_db, "driver");
  while(dbDriver) {
    const char *sDriverName;

    sDriverName=GWEN_DB_GetCharValue(dbDriver, "driverName", 0, NULL);
    if (sDriverName) {
      GWEN_DB_NODE *dbReader;

      dbReader=GWEN_DB_FindFirstGroup(dbDriver, "reader");
      while(dbReader) {
	const char *sReaderName;
	const char *sTmpl;

	sReaderName=GWEN_DB_GetCharValue(dbReader, "readerType", 0, NULL);
	sTmpl=GWEN_DB_GetCharValue(dbReader, "devicePathTmpl", 0, NULL);
	if (sReaderName && sTmpl) {
	  if (-1!=GWEN_Text_ComparePattern(readerName, sTmpl, 1)) {
	    /* reader found */
	    GWEN_Buffer_AppendString(driverType, sDriverName);
	    GWEN_Buffer_AppendString(readerType, sReaderName);
	    *pReaderFlags=LC_ReaderFlags_fromDb(dbReader, "flags");
	    DBG_INFO(LC_LOGDOMAIN,
		     "Reader [%s] is [%s]/[%s], %08x",
		     readerName,
		     sDriverName, sReaderName, *pReaderFlags);
	    return 0;
	  }
	}
	else {
	  DBG_INFO(LC_LOGDOMAIN,
                   "Either reader name or template missing");
	}
	dbReader=GWEN_DB_FindNextGroup(dbReader, "reader");
      }
    }
    else {
      DBG_INFO(LC_LOGDOMAIN,
	       "Driver name is missing");
    }
    dbDriver=GWEN_DB_FindNextGroup(dbDriver, "driver");
  }

  return GWEN_ERROR_NOT_FOUND;
}
开发者ID:rhvall,项目名称:SmartCard,代码行数:51,代码来源:client.c

示例13: GWEN_PathManager_GetMatchingFilesRecursively

int GWEN_PathManager_GetMatchingFilesRecursively(const char *destLib,
    const char *pathName,
    const char *subFolderName,
    GWEN_STRINGLIST *sl,
    const char *mask) {
  GWEN_DB_NODE *dbT;

  assert(gwen__paths);
  dbT=GWEN_DB_GetGroup(gwen__paths, GWEN_PATH_FLAGS_NAMEMUSTEXIST,
                       destLib);
  if (dbT) {
    dbT=GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST,
                         pathName);
    if (dbT) {
      int i;
      const char *s;
      GWEN_DB_NODE *dbN;
      GWEN_BUFFER *tbuf;

      tbuf=GWEN_Buffer_new(0, 256, 0, 1);

      /* check all paths */
      dbN=GWEN_DB_FindFirstGroup(dbT, "pair");
      while(dbN) {
        for (i=0; ; i++) {
          s=GWEN_DB_GetCharValue(dbN, "path", i, 0);
          if (!s)
            break;
          else {
            GWEN_Buffer_AppendString(tbuf, s);
            if (subFolderName && *subFolderName) {
              GWEN_Buffer_AppendString(tbuf, GWEN_DIR_SEPARATOR_S);
              GWEN_Buffer_AppendString(tbuf, subFolderName);
            }

            DBG_DEBUG(GWEN_LOGDOMAIN, "Trying \"%s\"",
                      GWEN_Buffer_GetStart(tbuf));
            GWEN_Directory_GetMatchingFilesRecursively(GWEN_Buffer_GetStart(tbuf), sl, mask);
            GWEN_Buffer_Reset(tbuf);
          }
        }

        dbN=GWEN_DB_FindNextGroup(dbN, "pair");
      }
      GWEN_Buffer_free(tbuf);
    }
  }

  return 0;
}
开发者ID:Zauberstuhl,项目名称:gwenhywfar,代码行数:50,代码来源:pathmanager.c

示例14: AB_Banking_GetAppUserDataDir

int AB_Banking_GetAppUserDataDir(const AB_BANKING *ab, GWEN_BUFFER *buf){
  int rv;

  assert(ab->appEscName);
  rv=AB_Banking_GetUserDataDir(ab, buf);
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d)", rv);
    return rv;
  }
  GWEN_Buffer_AppendString(buf, DIRSEP "apps" DIRSEP);
  GWEN_Buffer_AppendString(buf, ab->appEscName);
  GWEN_Buffer_AppendString(buf, DIRSEP "data");

  return 0;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:15,代码来源:banking_cfg.c

示例15: AHB_DTAUS__AddNum

int AHB_DTAUS__AddNum(GWEN_BUFFER *dst,
                      unsigned int size,
                      const char *s) {
  unsigned int i, j;

  assert(dst);
  assert(s);

  DBG_DEBUG(AQBANKING_LOGDOMAIN, "Adding num : %s", s);

  i=strlen(s);
  if (i>size) {
    /* Error out here because e.g. truncated BLZ will lead to failed jobs. */
    DBG_ERROR(AQBANKING_LOGDOMAIN, "Number \"%s\" too long: Has length %d but must not be longer than %d characters",
	      s, i, size);
    return -1;
  }
  j=size-i;
  if (j) {
    unsigned int k;

    for (k=0; k<j; k++)
      GWEN_Buffer_AppendByte(dst, '0');
  }
  GWEN_Buffer_AppendString(dst, s);
  return 0;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:27,代码来源:dtaus-export.c


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