本文整理汇总了C++中AString::Word方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::Word方法的具体用法?C++ AString::Word怎么用?C++ AString::Word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::Word方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadJPEGInfo
bool ReadJPEGInfo(const char *filename, JPEG_INFO& info)
{
EXIFINFO exinfo;
Exif exif(&exinfo);
FILE *fp;
bool success = false;
memset(&exinfo, 0, sizeof(exinfo));
if ((fp = fopen(filename, "rb")) != NULL) {
if (exif.DecodeExif(fp)) {
info.CameraMake = exinfo.CameraMake;
info.CameraModel = exinfo.CameraModel;
info.Width = exinfo.Width;
info.Height = exinfo.Height;
info.Orientation = exinfo.Orientation;
info.bDateValid = false;
info.Comments = exinfo.Comments;
AString str = exinfo.DateTime;
if (str.Valid()) {
//printf("File '%s' has date '%s'\n", filename, str.str());
str.Replace(":/-.", " ");
ADateTime& dt = info.DateTime;
uint_t word = 0;
uint16_t year = str.Word(word++);
uint8_t month = str.Word(word++);
uint8_t day = str.Word(word++);
uint8_t hour = str.Word(word++);
uint8_t minute = str.Word(word++);
uint8_t second = str.Word(word++);
if ((year >= 1980) && RANGE(month, 1, 12) && RANGE(day, 1, 31) && (hour <= 23) && (minute <= 59) && (second <= 61)) {
dt.Set(day, month, year, hour, minute, second);
info.bDateValid = true;
}
}
success = true;
}
fclose(fp);
}
return success;
}
示例2: GetColumnType
/*--------------------------------------------------------------------------------*/
AString PostgresDatabase::GetColumnType(const AString& column) const
{
AString ctype = column.Word(1);
AString type;
if ((type = ConvertSimpleType(ctype)).Empty())
{
if (ctype == "references") type.printf("integer references %s", column.Word(2).str()); // reference to another table
else if (ctype == "references64") type.printf("bigint references %s", column.Word(2).str()); // reference to another table (with 64-bit id)
else type = ctype;
}
return type;
}
示例3: ReadReplacementsFile
bool ADVBConfig::ReadReplacementsFile(std::vector<REPLACEMENT>& replacements, const AString& filename) const
{
AStdFile fp;
bool success = false;
if (fp.open(filename)) {
AString line;
//printf("Reading replacements file '%s':", filename.str());
while (line.ReadLn(fp) >= 0) {
int p = 0;
if ((line.Word(0)[0] != ';') && ((p = line.Pos("=")) >= 0)) {
REPLACEMENT repl = {
line.Left(p).Word(0).DeQuotify(),
line.Mid(p + 1).Word(0).DeQuotify(),
};
//printf("Replacement: '%s' -> '%s'", repl.search.str(), repl.replace.str());
replacements.push_back(repl);
}
}
fp.close();
success = true;
}
else logit("Failed to open replacements file '%s'", filename.str());
return success;
}
示例4: CreateTable
/*--------------------------------------------------------------------------------*/
bool PostgresDatabase::CreateTable(const AString& name, const AString& columns)
{
AString sql;
SQLQuery *query = NULL;
uint_t i, n = columns.CountColumns();
sql.printf("create table %s (", name.str());
for (i = 0; i < n; i++) {
AString column = columns.Column(i);
if (i > 0) sql.printf(", ");
sql.printf("%s %s", column.Word(0).str(), GetColumnType(column).str());
}
sql.printf(")");
if ((query = RunQuery(sql)) != NULL) {
bool success = query->GetResult();
delete query;
return success;
}
return false;
}