本文整理汇总了C++中freeCharString函数的典型用法代码示例。如果您正苦于以下问题:C++ freeCharString函数的具体用法?C++ freeCharString怎么用?C++ freeCharString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了freeCharString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: freeTaskTimer
void freeTaskTimer(TaskTimer self) {
if(self != NULL) {
freeCharString(self->component);
freeCharString(self->subcomponent);
free(self);
}
}
示例4: freeErrorReporter
void freeErrorReporter(ErrorReporter errorReporter) {
if (errorReporter != NULL) {
freeCharString(errorReporter->reportName);
freeCharString(errorReporter->reportDirPath);
freeCharString(errorReporter->desktopPath);
free(errorReporter);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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');
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}