• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ freeCharString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: copyFileToDirectory

boolByte copyFileToDirectory(const CharString fileAbsolutePath, const CharString directoryAbsolutePath) {
  boolByte result = false;
  CharString fileOutPath = newCharStringWithCapacity(kCharStringLengthLong);
  CharString fileBasename = NULL;
  FILE *input = NULL;
  FILE *output = NULL;
  char ch;

  fileBasename = newCharStringWithCString(getFileBasename(fileAbsolutePath->data));
  buildAbsolutePath(directoryAbsolutePath, fileBasename, NULL, fileOutPath);
  input = fopen(fileAbsolutePath->data, "rb");
  if(input != NULL) {
    output = fopen(fileOutPath->data, "wb");
    if(output != NULL) {
      while(fread(&ch, 1, 1, input) == 1) {
        fwrite(&ch, 1, 1, output);
      }
      result = true;
    }
  }

  if(input != NULL) {
    fclose(input);
  }
  if(output != NULL) {
    fclose(output);
  }
  freeCharString(fileOutPath);
  freeCharString(fileBasename);
  return result;
}
开发者ID:ZECTBynmo,项目名称:MrsWatson,代码行数:31,代码来源:FileUtilities.c


示例2: _testLoadPluginWithAbsolutePath

static int _testLoadPluginWithAbsolutePath(const char *testName,
                                           const CharString applicationPath,
                                           const CharString resourcesPath) {
  File resourcesFile = newFileWithPath(resourcesPath);
  CharString vstDirName = newCharStringWithCString("vst");
  File vstFile = newFileWithParent(resourcesFile, vstDirName);
  freeFile(resourcesFile);
  freeCharString(vstDirName);

  PlatformInfo platformInfo = newPlatformInfo();
  CharString platformDirName =
      newCharStringWithCString(_getPlatformVstDirName(platformInfo));
  File vstPlatformFile = newFileWithParent(vstFile, platformDirName);
  freeCharString(platformDirName);
  freePlatformInfo(platformInfo);
  freeFile(vstFile);

  CharString vstPluginName = newCharStringWithCString("again");
  charStringAppendCString(vstPluginName, _getVst2xPlatformExtension());
  File pluginFile = newFileWithParent(vstPlatformFile, vstPluginName);
  freeCharString(vstPluginName);
  freeFile(vstPlatformFile);

  CharString inputPath = getDefaultInputPath(resourcesPath);
  int result = runIntegrationTest(
      testName,
      buildTestArgumentString("--plugin \"%s\" --input \"%s\"",
                              pluginFile->absolutePath->data, inputPath->data),
      RETURN_CODE_SUCCESS, kTestOutputPcm, applicationPath, resourcesPath);
  freeCharString(inputPath);
  freeFile(pluginFile);
  return result;
}
开发者ID:nano-bot,项目名称:MrsWatson,代码行数:33,代码来源:IntegrationTests.c


示例3: freeTaskTimer

void freeTaskTimer(TaskTimer self) {
  if(self != NULL) {
    freeCharString(self->component);
    freeCharString(self->subcomponent);
    free(self);
  }
}
开发者ID:denisfitz57,项目名称:MrsWatson,代码行数:7,代码来源:TaskTimer.c


示例4: freeErrorReporter

void freeErrorReporter(ErrorReporter errorReporter) {
  if (errorReporter != NULL) {
    freeCharString(errorReporter->reportName);
    freeCharString(errorReporter->reportDirPath);
    freeCharString(errorReporter->desktopPath);
    free(errorReporter);
  }
}
开发者ID:nano-bot,项目名称:MrsWatson,代码行数:8,代码来源:ErrorReporter.c


示例5: errorReporterRemapPath

void errorReporterRemapPath(ErrorReporter self, CharString path) {
  CharString basename = newCharString();
  CharString outString = newCharStringWithCapacity(path->capacity);

  charStringCopyCString(basename, getFileBasename(path->data));
  buildAbsolutePath(self->reportDirPath, basename, NULL, outString);
  charStringCopy(path, outString);

  freeCharString(basename);
  freeCharString(outString);
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:11,代码来源:ErrorReporter.c


示例6: _testBuildAbsolutePathNullFile

static int _testBuildAbsolutePathNullFile(void) {
  CharString d = getCurrentDirectory();
  CharString out = newCharString();

  buildAbsolutePath(d, NULL, NULL, out);
  assert(charStringIsEmpty(out));

  freeCharString(d);
  freeCharString(out);
  return 0;
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:11,代码来源:FileUtilitiesTest.c


示例7: _testBuildAbsolutePathNullPath

static int _testBuildAbsolutePathNullPath(void) {
  CharString f = newCharString();
  CharString out = newCharString();

  buildAbsolutePath(NULL, f, NULL, out);
  assert(charStringIsEmpty(out));

  freeCharString(f);
  freeCharString(out);
  return 0;
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:11,代码来源:FileUtilitiesTest.c


示例8: _testPluginFactoryEmptyPluginName

static int _testPluginFactoryEmptyPluginName(void)
{
    CharString invalid = newCharString();
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(invalid, pluginRoot);

    assertIsNull(p);

    freeCharString(invalid);
    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
开发者ID:JC-Morph,项目名称:MrsWatson,代码行数:13,代码来源:PluginTest.c


示例9: _testPluginFactoryInvalidPlugin

static int _testPluginFactoryInvalidPlugin(void)
{
    CharString invalid = newCharStringWithCString("invalid");
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(invalid, pluginRoot);

    assertIsNull(p);

    freeCharString(invalid);
    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
开发者ID:JC-Morph,项目名称:MrsWatson,代码行数:13,代码来源:PluginTest.c


示例10: _testBuildAbsolutePathEmptyPath

static int _testBuildAbsolutePathEmptyPath(void) {
  CharString d = newCharString();
  CharString f = newCharStringWithCString(TEST_FILENAME);
  CharString out = newCharString();

  buildAbsolutePath(d, f, NULL, out);
  assert(charStringIsEmpty(out));

  freeCharString(d);
  freeCharString(f);
  freeCharString(out);
  return 0;
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:13,代码来源:FileUtilitiesTest.c


示例11: errorReporterShouldCopyPlugins

boolByte errorReporterShouldCopyPlugins(void) {
  CharString promptText = newCharStringWithCString(kErrorReportCopyPluginsPromptText);
  CharString wrappedPromptText;
  char response;

  wrappedPromptText = charStringWrap(promptText, 0);
  printf("%s", wrappedPromptText->data);
  freeCharString(wrappedPromptText);
  freeCharString(promptText);

  response = getchar();
  return (response == 'y' || response == 'Y');
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:13,代码来源:ErrorReporter.c


示例12: printVersion

static void printVersion(void) {
  CharString versionString = buildInfoGetVersionString();
  CharString wrappedLicenseInfo;
  CharString licenseString = newCharStringWithCString(LICENSE_STRING);

  printf("%s, build %ld\nCopyright (c) %ld, %s. All rights reserved.\n\n",
    versionString->data, buildInfoGetDatestamp(), buildInfoGetYear(), VENDOR_NAME);
  wrappedLicenseInfo = charStringWrap(licenseString, 0);
  printf("%s\n\n", wrappedLicenseInfo->data);

  freeCharString(licenseString);
  freeCharString(wrappedLicenseInfo);
  freeCharString(versionString);
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:14,代码来源:MrsWatson.c


示例13: _testCopyInvalidFileToDirectory

static int _testCopyInvalidFileToDirectory(void) {
  CharString tempDir = _fileUtilitiesMakeTempDir();
  CharString testFilename = newCharStringWithCString(TEST_FILENAME);
  CharString invalid = newCharStringWithCString("invalid");

  convertRelativePathToAbsolute(testFilename, invalid);
  assertFalse(copyFileToDirectory(invalid, tempDir));
  removeDirectory(tempDir);

  freeCharString(testFilename);
  freeCharString(tempDir);
  freeCharString(invalid);
  return 0;
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:14,代码来源:FileUtilitiesTest.c


示例14: _testLoadFxpPresetInVst

static int _testLoadFxpPresetInVst(const char *testName,
                                   const CharString applicationPath,
                                   const CharString resourcesPath) {
  CharString inputPath = getDefaultInputPath(resourcesPath);
  CharString presetPath =
      getTestResourcePath(resourcesPath, "presets", "again-test.fxp");
  int result = runIntegrationTest(
      testName, buildTestArgumentString("--plugin \"again,%s\" --input \"%s\"",
                                        presetPath->data, inputPath->data),
      RETURN_CODE_SUCCESS, kTestOutputPcm, applicationPath, resourcesPath);
  freeCharString(inputPath);
  freeCharString(presetPath);
  return result;
}
开发者ID:nano-bot,项目名称:MrsWatson,代码行数:14,代码来源:IntegrationTests.c


示例15: _testPluginFactory

static int _testPluginFactory(void)
{
    CharString silence = newCharStringWithCString("mrs_silence");
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(silence, pluginRoot);

    assertNotNull(p);
    assertIntEquals(PLUGIN_TYPE_INTERNAL, p->interfaceType);
    assertCharStringEquals(silence->data, p->pluginName);

    freeCharString(silence);
    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
开发者ID:JC-Morph,项目名称:MrsWatson,代码行数:15,代码来源:PluginTest.c


示例16: _testNewFileWithAbsolutePath

static int _testNewFileWithAbsolutePath(void) {
  CharString p = newCharString();
  sprintf(p->data, "%s%c%s", "test", PATH_DELIMITER, "file");
  freeCharString(c);
  
  return 0;
}
开发者ID:ZECTBynmo,项目名称:MrsWatson,代码行数:7,代码来源:FileTest.c


示例17: removeDirectory

boolByte removeDirectory(const CharString absolutePath) {
  boolByte result = false;

#if UNIX
  if(!fileExists(absolutePath->data)) {
    return false;
  }

  // This is a bit lazy, perhaps...
  CharString removeCommand = newCharString();
  snprintf(removeCommand->data, removeCommand->length, "/bin/rm -rf \"%s\"", absolutePath->data);
  result = system(removeCommand->data);
  freeCharString(removeCommand);
  return (result == 0);
#elif WINDOWS
  SHFILEOPSTRUCTA fileOperation = {0};
  fileOperation.wFunc = FO_DELETE;
  fileOperation.pFrom = absolutePath->data;
  fileOperation.fFlags = FOF_NO_UI;
  return (SHFileOperationA(&fileOperation) == 0);
#else
  logUnsupportedFeature("Copy directory recursively");
  return false;
#endif
}
开发者ID:ZECTBynmo,项目名称:MrsWatson,代码行数:25,代码来源:FileUtilities.c


示例18: _findProgramOption

static ProgramOption _findProgramOption(ProgramOptions self, const char* name) {
  ProgramOption potentialMatchOption, optionMatch;
  CharString optionStringWithoutDashes;
  unsigned int i;

  if(_isStringShortOption(name)) {
    for(i = 0; i < self->numOptions; i++) {
      potentialMatchOption = self->options[i];
      if(potentialMatchOption->hasShortForm && potentialMatchOption->name->data[0] == name[1]) {
        return potentialMatchOption;
      }
    }
  }

  if(_isStringLongOption(name)) {
    optionMatch = NULL;
    optionStringWithoutDashes = newCharStringWithCapacity(kCharStringLengthShort);
    strncpy(optionStringWithoutDashes->data, name + 2, strlen(name) - 2);
    for(i = 0; i < self->numOptions; i++) {
      potentialMatchOption = self->options[i];
      if(charStringIsEqualTo(potentialMatchOption->name, optionStringWithoutDashes, false)) {
        optionMatch = potentialMatchOption;
        break;
      }
    }
    freeCharString(optionStringWithoutDashes);
    return optionMatch;
  }

  // If no option was found, then return null
  return NULL;
}
开发者ID:Notalib,项目名称:MrsWatson,代码行数:32,代码来源:ProgramOption.c


示例19: _logMessage

static void _logMessage(const LogLevel logLevel, const char *message, va_list arguments)
{
    long elapsedTimeInMs;
    EventLogger eventLogger = _getEventLoggerInstance();
#if WINDOWS
    ULONGLONG currentTime;
#else
    struct timeval currentTime;
#endif

    if (eventLogger != NULL && logLevel >= eventLogger->logLevel) {
        CharString formattedMessage = newCharStringWithCapacity(kCharStringLengthDefault * 2);
        vsnprintf(formattedMessage->data, formattedMessage->capacity, message, arguments);
#if WINDOWS
        currentTime = GetTickCount();
        elapsedTimeInMs = (unsigned long)(currentTime - eventLogger->startTimeInMs);
#else
        gettimeofday(&currentTime, NULL);
        elapsedTimeInMs = ((currentTime.tv_sec - (eventLogger->startTimeInSec + 1)) * 1000) +
                          (currentTime.tv_usec / 1000) + (1000 - eventLogger->startTimeInMs);
#endif
        _printMessage(logLevel, elapsedTimeInMs, getAudioClock()->currentFrame, formattedMessage->data, eventLogger);
        freeCharString(formattedMessage);
    }
}
开发者ID:JC-Morph,项目名称:MrsWatson,代码行数:25,代码来源:EventLogger.c


示例20: _testAppendItemToNullList

static int _testAppendItemToNullList(void) {
  CharString c = newCharString();
  // The test here is not to crash
  linkedListAppend(NULL, c);
  freeCharString(c);
  return 0;
}
开发者ID:ZECTBynmo,项目名称:MrsWatson,代码行数:7,代码来源:LinkedListTest.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ freeClient函数代码示例发布时间:2022-05-30
下一篇:
C++ freeArrayOfString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap