bool WsdlGeneratorHelper::createOutputFile(void) { bool success = true; try { protoFilenameNoExt = stripExtension(proto->name()); protoFilenameNoExtNoPath = stripPath(protoFilenameNoExt); string wsdlName = protoFilenameNoExtNoPath; wsdlName.append(".wsdl"); wsdl = outputDirectory->Open(wsdlName); success = writeFileContents(); } catch (string s) { success = false; *error = s; } return success; }
static int do_keychain_export(const char *backupPath, const char *keybagPath, const char *passwordString) { CFDataRef backup=NULL; CFDataRef keybag=NULL; CFDataRef password=NULL; bool ok=false; if(passwordString) { require(password = CFDataCreate(NULL, (UInt8 *)passwordString, strlen(passwordString)), out); } require(keybag=copyFileContents(keybagPath), out); require(backup=_SecKeychainCopyBackup(keybag, password), out); ok=writeFileContents(backupPath, backup); out: CFReleaseSafe(backup); CFReleaseSafe(keybag); CFReleaseSafe(password); return ok?0:1; }