本文整理汇总了C++中firebird::PathName类的典型用法代码示例。如果您正苦于以下问题:C++ PathName类的具体用法?C++ PathName怎么用?C++ PathName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PathName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LEX_init
void LEX_init( void *file)
{
/**************************************
*
* L E X _ i n i t
*
**************************************
*
* Functional description
* Initialize for lexical scanning. While we're at it, open a
* scratch trace file to keep all input.
*
**************************************/
const Firebird::PathName filename = Firebird::TempFile::create(SCRATCH);
strcpy(trace_file_name, filename.c_str());
trace_file = fopen(trace_file_name, "w+b");
if (!trace_file)
{
DDL_err(276);
/* msg 276: couldn't open scratch file */
}
input_file = (FILE*) file;
DDL_char = DDL_buffer;
dudleyGlob.DDL_token.tok_position = 0;
dudleyGlob.DDL_description = false;
dudleyGlob.DDL_line = 1;
}
开发者ID:andrewleech,项目名称:firebird,代码行数:28,代码来源:lex.cpp
示例2: extractDataFromPluginTo
void ClntAuthBlock::extractDataFromPluginTo(Firebird::ClumpletWriter& user_id)
{
// Add user login name
if (cliOrigUserName.hasData())
{
HANDSHAKE_DEBUG(fprintf(stderr, "Cli: extractDataFromPluginTo: cliOrigUserName=%s\n",
cliOrigUserName.c_str()));
user_id.insertString(CNCT_login, cliOrigUserName);
}
// Add plugin name
Firebird::PathName pluginName = getPluginName();
if (pluginName.hasData())
{
HANDSHAKE_DEBUG(fprintf(stderr, "Cli: extractDataFromPluginTo: pluginName=%s\n", pluginName.c_str()));
user_id.insertPath(CNCT_plugin_name, pluginName);
}
// Add plugin list
if (pluginList.hasData())
{
user_id.insertPath(CNCT_plugin_list, pluginList);
}
// This is specially tricky field - user_id is limited to 255 bytes per entry,
// and we have no ways to override this limit cause it can be sent to any version server.
// Therefore divide data into 254-byte parts, leaving first byte for the number of that part.
// This appears more reliable than put them in strict order.
addMultiPartConnectParameter(dataFromPlugin, user_id, CNCT_specific_data);
// Client's wirecrypt requested level
user_id.insertInt(CNCT_client_crypt, clntConfig->getWireCrypt(WC_CLIENT));
}
开发者ID:RAvenGEr,项目名称:opencvr,代码行数:33,代码来源:remote.cpp
示例3: doctorModuleExtention
void ModuleLoader::doctorModuleExtention(Firebird::PathName& name)
{
Firebird::PathName::size_type pos = name.rfind(".dylib");
if (pos != Firebird::PathName::npos && pos == name.length() - 6)
return; // No doctoring necessary
name += ".dylib";
}
开发者ID:narolez571,项目名称:firebird,代码行数:7,代码来源:mod_loader.cpp
示例4: LEX_init
void LEX_init()
{
/**************************************
*
* L E X _ i n i t
*
**************************************
*
* Functional description
* Initialize for lexical scanning. While we're at it, open a
* scratch trace file to keep all input.
*
**************************************/
const Firebird::PathName filename = TempFile::create(SCRATCH);
strcpy(trace_file_name, filename.c_str());
trace_file = fopen(trace_file_name, "w+b");
#ifdef UNIX
unlink(trace_file_name);
#endif
if (!trace_file)
IBERROR(61); // Msg 61 couldn't open scratch file
QLI_token = (qli_tok*) ALLOCPV(type_tok, MAXSYMLEN);
QLI_line = (qli_line*) ALLOCPV(type_line, 0);
QLI_line->line_size = sizeof(QLI_line->line_data);
QLI_line->line_ptr = QLI_line->line_data;
QLI_line->line_type = line_stdin;
QLI_line->line_source_file = stdin;
QLI_semi = false;
input_file = stdin;
HSH_init();
}
开发者ID:narolez571,项目名称:firebird,代码行数:34,代码来源:lex.cpp
示例5: getDbPathInfo
// moves DB path information (from limbo transaction) to another buffer
void getDbPathInfo(unsigned int& itemsLength, const unsigned char*& items,
unsigned int& bufferLength, unsigned char*& buffer,
Firebird::Array<unsigned char>& newItemsBuffer, const Firebird::PathName& dbpath)
{
if (itemsLength && items)
{
const unsigned char* ptr = (const unsigned char*) memchr(items, fb_info_tra_dbpath, itemsLength);
if (ptr)
{
newItemsBuffer.add(items, itemsLength);
newItemsBuffer.remove(ptr - items);
items = newItemsBuffer.begin();
--itemsLength;
unsigned int len = dbpath.length();
if (len + 3 > bufferLength)
{
len = bufferLength - 3;
}
bufferLength -= (len + 3);
*buffer++ = fb_info_tra_dbpath;
*buffer++ = len;
*buffer++ = len >> 8;
memcpy(buffer, dbpath.c_str(), len);
buffer += len;
}
}
}
开发者ID:mariuz,项目名称:firebird,代码行数:29,代码来源:utils.cpp
示例6: ensureSeparator
// We don't work correctly with MBCS.
void PathUtils::ensureSeparator(Firebird::PathName& in_out)
{
if (in_out.length() == 0)
in_out = PathUtils::dir_sep;
if (in_out[in_out.length() - 1] != PathUtils::dir_sep)
in_out += PathUtils::dir_sep;
}
开发者ID:narolez571,项目名称:firebird,代码行数:9,代码来源:path_utils.cpp
示例7: isSymLink
bool PathUtils::isSymLink(const Firebird::PathName& path)
{
struct stat st, lst;
if (stat(path.c_str(), &st) != 0)
return false;
if (lstat(path.c_str(), &lst) != 0)
return false;
return st.st_ino != lst.st_ino;
}
开发者ID:narolez571,项目名称:firebird,代码行数:9,代码来源:path_utils.cpp
示例8: splitPrefix
void PathUtils::splitPrefix(Firebird::PathName& path, Firebird::PathName& prefix)
{
prefix.erase();
while (path.hasData() && path[0] == dir_sep)
{
prefix = dir_sep;
path.erase(0, 1);
}
}
开发者ID:narolez571,项目名称:firebird,代码行数:9,代码来源:path_utils.cpp
示例9: isLoadableModule
bool ModuleLoader::isLoadableModule(const Firebird::PathName& module)
{
struct stat sb;
if (-1 == stat(module.c_str(), &sb))
return false;
if ( ! (sb.st_mode & S_IFREG) ) // Make sure it is a plain file
return false;
if ( -1 == access(module.c_str(), R_OK | X_OK))
return false;
return true;
}
开发者ID:RAvenGEr,项目名称:opencvr,代码行数:11,代码来源:mod_loader.cpp
示例10: getCwd
void getCwd(Firebird::PathName& pn)
{
char* buffer = pn.getBuffer(MAXPATHLEN);
#if defined(WIN_NT)
_getcwd(buffer, MAXPATHLEN);
#elif defined(HAVE_GETCWD)
FB_UNUSED(getcwd(buffer, MAXPATHLEN));
#else
FB_UNUSED(getwd(buffer));
#endif
pn.recalculate_length();
}
开发者ID:mariuz,项目名称:firebird,代码行数:12,代码来源:utils.cpp
示例11: setupFile
TempFile* TempSpace::setupFile(size_t size)
{
ISC_STATUS_ARRAY status_vector = {0};
for (size_t i = 0; i < tempDirs->getCount(); i++)
{
TempFile* file = NULL;
Firebird::PathName directory = (*tempDirs)[i];
PathUtils::ensureSeparator(directory);
for (size_t j = 0; j < tempFiles.getCount(); j++)
{
Firebird::PathName dirname, filename;
PathUtils::splitLastComponent(dirname, filename, tempFiles[j]->getName());
PathUtils::ensureSeparator(dirname);
if (!directory.compare(dirname))
{
file = tempFiles[j];
break;
}
}
try
{
if (!file)
{
file = FB_NEW(pool) TempFile(pool, filePrefix, directory);
tempFiles.add(file);
}
file->extend(size);
}
catch (const Firebird::system_error& ex)
{
ex.stuff_exception(status_vector);
continue;
}
return file;
}
// no room in all directories
Firebird::Arg::Gds status(isc_out_of_temp_space);
status.append(Firebird::Arg::StatusVector(status_vector));
iscLogStatus(NULL, status.value());
status.raise();
return NULL; // compiler silencer
}
开发者ID:AsylumCorp,项目名称:dsploit,代码行数:50,代码来源:TempSpace.cpp
示例12: doctorModuleExtension
void ModuleLoader::doctorModuleExtension(Firebird::PathName& name)
{
Firebird::PathName::size_type pos = name.rfind('/');
pos = (pos == Firebird::PathName::npos) ? 0 : pos + 1;
if (name.find("lib", pos) != pos)
{
name.insert(pos, "lib");
}
pos = name.rfind(".dylib");
if (pos == name.length() - 6)
return;
name += ".dylib";
}
开发者ID:RAvenGEr,项目名称:opencvr,代码行数:14,代码来源:mod_loader.cpp
示例13: renameFile
bool FileObject::renameFile(const Firebird::PathName new_filename)
{
if (append_mutex != INVALID_HANDLE_VALUE)
{
if (WaitForSingleObject(append_mutex, INFINITE) != WAIT_OBJECT_0)
system_call_failed::raise("WaitForSingleObject");
}
if (!MoveFile(filename.c_str(), new_filename.c_str()))
{
DWORD rename_err = GetLastError();
if (rename_err == ERROR_ALREADY_EXISTS || rename_err == ERROR_FILE_NOT_FOUND)
{
// Another process renames our file just now. Open it again.
reopen();
return false;
}
if (append_mutex != INVALID_HANDLE_VALUE)
ReleaseMutex(append_mutex);
fatal_exception::raiseFmt("IO error (%d) renaming file: %s",
rename_err,
filename.c_str());
}
else
reopen();
return true;
}
开发者ID:Alexpux,项目名称:firebird,代码行数:30,代码来源:FileObject.cpp
示例14: readenv
bool readenv(const char* env_name, Firebird::PathName& env_value)
{
Firebird::string result;
bool rc = readenv(env_name, result);
env_value.assign(result.c_str(), result.length());
return rc;
}
开发者ID:mariuz,项目名称:firebird,代码行数:7,代码来源:utils.cpp
示例15: notifyDatabaseName
// Probably file arrived on the disk
bool notifyDatabaseName(const Firebird::PathName& file)
{
#ifdef HAVE_ID_BY_NAME
// notifyDatabaseName typically causes changes in aliasesConf()
// cause it's called only from Config created for missing database.
// Therefore always take write lock at once.
WriteLockGuard guard(aliasesConf().rwLock, "notifyDatabaseName");
DbName* db = aliasesConf().dbHash.lookup(file);
if (!db)
return true;
if (db->id)
return true;
UCharBuffer id;
os_utils::getUniqueFileId(file.c_str(), id);
if (id.hasData())
{
aliasesConf().linkId(db, id);
return true;
}
#endif
return false;
}
开发者ID:Salmista-94,项目名称:firebird,代码行数:26,代码来源:db_alias.cpp
示例16: isRelative
bool PathUtils::isRelative(const Firebird::PathName& path)
{
if (path.length() > 0)
{
char ds = path[0];
if (path.length() > 2) {
if (path[1] == ':' &&
(('A' <= path[0] && path[0] <= 'Z') ||
('a' <= path[0] && path[0] <= 'z')))
{
ds = path[2];
}
}
return ds != PathUtils::dir_sep && ds != '/';
}
return true;
}
开发者ID:andrewleech,项目名称:firebird,代码行数:17,代码来源:path_utils.cpp
示例17: LEX_edit
void LEX_edit(SLONG start, SLONG stop)
{
/**************************************
*
* L E X _ e d i t
*
**************************************
*
* Functional description
* Dump the last full statement into a scratch file, then
* push the scratch file on the input stack.
*
**************************************/
const Firebird::PathName filename = TempFile::create(SCRATCH);
FILE* scratch = fopen(filename.c_str(), "w+b");
if (!scratch)
IBERROR(61); // Msg 61 couldn't open scratch file
#ifdef WIN_NT
stop--;
#endif
if (fseek(trace_file, start, 0))
{
fseek(trace_file, 0, 2);
IBERROR(59); // Msg 59 fseek failed
}
while (++start <= stop)
{
const SSHORT c = getc(trace_file);
if (c == EOF)
break;
putc(c, scratch);
}
fclose(scratch);
if (gds__edit(filename.c_str(), TRUE))
LEX_push_file(filename.c_str(), true);
unlink(filename.c_str());
fseek(trace_file, 0, 2);
}
开发者ID:narolez571,项目名称:firebird,代码行数:45,代码来源:lex.cpp
示例18: doctorModuleExtension
bool ModuleLoader::doctorModuleExtension(Firebird::PathName& name, int& step)
{
if (name.isEmpty())
return false;
switch (step++)
{
case 0: // Step 0: append missing extension
{
Firebird::PathName::size_type pos = name.rfind("." SHRLIB_EXT);
if (pos != name.length() - 3)
{
pos = name.rfind("." SHRLIB_EXT ".");
if (pos == Firebird::PathName::npos)
{
name += "." SHRLIB_EXT;
return true;
}
}
step++; // instead of break
}
case 1: // Step 1: insert missing prefix
{
Firebird::PathName::size_type pos = name.rfind('/');
pos = (pos == Firebird::PathName::npos) ? 0 : pos + 1;
if (name.find("lib", pos) != pos)
{
name.insert(pos, "lib");
return true;
}
}
}
return false;
}
开发者ID:FirebirdSQL,项目名称:firebird,代码行数:34,代码来源:mod_loader.cpp
示例19: isRelative
bool PathUtils::isRelative(const Firebird::PathName& path)
{
if (path.length() > 0)
{
const char ds = hasDriveLetter(path) ? path[2] : path[0];
return ds != PathUtils::dir_sep && ds != '/';
}
return true;
}
开发者ID:narolez571,项目名称:firebird,代码行数:9,代码来源:path_utils.cpp
示例20: setPrefixIfNotEmpty
inline void setPrefixIfNotEmpty(const Firebird::PathName& prefix, SSHORT arg_type)
{
/**************************************
*
* s e t P r e f i x I f N o t E m p t y
*
**************************************
*
* Functional description
* Helper for ISC_set_prefix
*
**************************************/
if (prefix.hasData())
{
// ignore here return value of gds__get_prefix():
// it will never fail with our good arguments
gds__get_prefix(arg_type, prefix.c_str());
}
}
开发者ID:AsylumCorp,项目名称:dsploit,代码行数:19,代码来源:isc.cpp
注:本文中的firebird::PathName类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论