mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
std:: prefix
This commit is contained in:
parent
4ff636253f
commit
93ea82e5c2
10 changed files with 51 additions and 51 deletions
|
@ -65,7 +65,7 @@ void StyleSheetTableParser::processAtRule(const std::string &name, const StyleSh
|
|||
|
||||
shared_ptr<ZLTextStyleEntry> StyleSheetSingleStyleParser::parseString(const char *text) {
|
||||
myReadState = WAITING_FOR_ATTRIBUTE;
|
||||
parse(text, strlen(text), true);
|
||||
parse(text, std::strlen(text), true);
|
||||
shared_ptr<ZLTextStyleEntry> control = StyleSheetTable::createControl(myMap);
|
||||
reset();
|
||||
return control;
|
||||
|
@ -106,7 +106,7 @@ void StyleSheetParser::parse(const char *text, int len, bool final) {
|
|||
const char *start = text;
|
||||
const char *end = text + len;
|
||||
for (const char *ptr = start; ptr != end; ++ptr) {
|
||||
if (isspace(*ptr)) {
|
||||
if (std::isspace(*ptr)) {
|
||||
if (start != ptr) {
|
||||
myWord.append(start, ptr - start);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ void StyleSheetTable::addMap(const std::string &tag, const std::string &aClass,
|
|||
static bool parseLength(const std::string &toParse, short &size, ZLTextStyleEntry::SizeUnit &unit) {
|
||||
if (ZLStringUtil::stringEndsWith(toParse, "%")) {
|
||||
unit = ZLTextStyleEntry::SIZE_UNIT_PERCENT;
|
||||
size = atoi(toParse.c_str());
|
||||
size = std::atoi(toParse.c_str());
|
||||
return true;
|
||||
} else if (ZLStringUtil::stringEndsWith(toParse, "em")) {
|
||||
unit = ZLTextStyleEntry::SIZE_UNIT_EM_100;
|
||||
|
@ -69,11 +69,11 @@ static bool parseLength(const std::string &toParse, short &size, ZLTextStyleEntr
|
|||
return true;
|
||||
} else if (ZLStringUtil::stringEndsWith(toParse, "px")) {
|
||||
unit = ZLTextStyleEntry::SIZE_UNIT_PIXEL;
|
||||
size = atoi(toParse.c_str());
|
||||
size = std::atoi(toParse.c_str());
|
||||
return true;
|
||||
} else if (ZLStringUtil::stringEndsWith(toParse, "pt")) {
|
||||
unit = ZLTextStyleEntry::SIZE_UNIT_POINT;
|
||||
size = atoi(toParse.c_str());
|
||||
size = std::atoi(toParse.c_str());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -404,7 +404,7 @@ HtmlBookReader::~HtmlBookReader() {
|
|||
void HtmlBookReader::addConvertedDataToBuffer(const char *text, std::size_t len, bool convert) {
|
||||
if (len > 0) {
|
||||
if (myDontBreakParagraph) {
|
||||
while ((len > 0) && isspace(*text)) {
|
||||
while (len > 0 && std::isspace(*text)) {
|
||||
--len;
|
||||
++text;
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ void HtmlBookReader::preformattedCharacterDataHandler(const char *text, std::siz
|
|||
myBookReader.beginParagraph();
|
||||
start = ptr + 1;
|
||||
} else if (mySpaceCounter >= 0) {
|
||||
if (isspace((unsigned char)*ptr)) {
|
||||
if (std::isspace((unsigned char)*ptr)) {
|
||||
++mySpaceCounter;
|
||||
} else {
|
||||
myBookReader.addFixedHSpace(mySpaceCounter);
|
||||
|
@ -475,7 +475,7 @@ void HtmlBookReader::preformattedCharacterDataHandler(const char *text, std::siz
|
|||
addConvertedDataToBuffer(start, end - start, convert);
|
||||
} else if (breakType & PlainTextFormat::BREAK_PARAGRAPH_AT_LINE_WITH_INDENT) {
|
||||
for (const char *ptr = text; ptr != end; ++ptr) {
|
||||
if (isspace((unsigned char)*ptr)) {
|
||||
if (std::isspace((unsigned char)*ptr)) {
|
||||
if (*ptr == '\n') {
|
||||
mySpaceCounter = 0;
|
||||
} else if (mySpaceCounter >= 0) {
|
||||
|
@ -499,7 +499,7 @@ void HtmlBookReader::preformattedCharacterDataHandler(const char *text, std::siz
|
|||
}
|
||||
} else if (breakType & PlainTextFormat::BREAK_PARAGRAPH_AT_EMPTY_LINE) {
|
||||
for (const char *ptr = start; ptr != end; ++ptr) {
|
||||
if (isspace((unsigned char)*ptr)) {
|
||||
if (std::isspace((unsigned char)*ptr)) {
|
||||
if (*ptr == '\n') {
|
||||
++myBreakCounter;
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ bool HtmlBookReader::characterDataHandler(const char *text, std::size_t len, boo
|
|||
const char *end = text + len;
|
||||
if (!myIsStarted) {
|
||||
for (; ptr != end; ++ptr) {
|
||||
if (!isspace((unsigned char)*ptr)) {
|
||||
if (!std::isspace((unsigned char)*ptr)) {
|
||||
myIsStarted = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -64,8 +64,8 @@ void CollectionReader::startElementHandler(const char *tag, const char **attribu
|
|||
}
|
||||
static const std::string _name = "name";
|
||||
static const std::string _number = "number";
|
||||
if ((_name == attributes[0]) && (_number == attributes[2])) {
|
||||
myCollection[attributes[1]] = atoi(attributes[3]);
|
||||
if (_name == attributes[0] && _number == attributes[2]) {
|
||||
myCollection[attributes[1]] = std::atoi(attributes[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ void HtmlReader::setTag(HtmlTag &tag, const std::string &name) {
|
|||
|
||||
const std::size_t len = tag.Name.length();
|
||||
for (std::size_t i = 0; i < len; ++i) {
|
||||
tag.Name[i] = toupper(tag.Name[i]);
|
||||
tag.Name[i] = std::toupper(tag.Name[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,9 +79,9 @@ enum SpecialType {
|
|||
|
||||
static bool allowSymbol(SpecialType type, char ch) {
|
||||
return
|
||||
((type == ST_NAME) && isalpha(ch)) ||
|
||||
((type == ST_DEC) && isdigit(ch)) ||
|
||||
((type == ST_HEX) && isxdigit(ch));
|
||||
(type == ST_NAME && std::isalpha(ch)) ||
|
||||
(type == ST_DEC && std::isdigit(ch)) ||
|
||||
(type == ST_HEX && std::isxdigit(ch));
|
||||
}
|
||||
|
||||
static int specialSymbolNumber(SpecialType type, const std::string &txt) {
|
||||
|
@ -90,9 +90,9 @@ static int specialSymbolNumber(SpecialType type, const std::string &txt) {
|
|||
case ST_NAME:
|
||||
return HtmlEntityCollection::symbolNumber(txt);
|
||||
case ST_DEC:
|
||||
return strtol(txt.c_str() + 1, &end, 10);
|
||||
return std::strtol(txt.c_str() + 1, &end, 10);
|
||||
case ST_HEX:
|
||||
return strtol(txt.c_str() + 2, &end, 16);
|
||||
return std::strtol(txt.c_str() + 2, &end, 16);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void HtmlReader::readDocument(ZLInputStream &stream) {
|
|||
if (state_special == ST_UNKNOWN) {
|
||||
if (*ptr == '#') {
|
||||
state_special = ST_NUM;
|
||||
} else if (isalpha(*ptr)) {
|
||||
} else if (std::isalpha(*ptr)) {
|
||||
state_special = ST_NAME;
|
||||
} else {
|
||||
start = ptr;
|
||||
|
@ -166,7 +166,7 @@ void HtmlReader::readDocument(ZLInputStream &stream) {
|
|||
} else if (state_special == ST_NUM) {
|
||||
if (*ptr == 'x') {
|
||||
state_special = ST_HEX;
|
||||
} else if (isdigit(*ptr)) {
|
||||
} else if (std::isdigit(*ptr)) {
|
||||
state_special = ST_DEC;
|
||||
} else {
|
||||
start = ptr;
|
||||
|
@ -231,13 +231,13 @@ void HtmlReader::readDocument(ZLInputStream &stream) {
|
|||
}
|
||||
break;
|
||||
case PS_TAGNAME:
|
||||
if ((*ptr == '>') || (*ptr == '/') || isspace((unsigned char)*ptr)) {
|
||||
if (*ptr == '>' || *ptr == '/' || std::isspace((unsigned char)*ptr)) {
|
||||
currentString.append(start, ptr - start);
|
||||
start = ptr + 1;
|
||||
setTag(currentTag, currentString);
|
||||
currentString.erase();
|
||||
if (currentTag.Name == "") {
|
||||
state = (*ptr == '>') ? PS_TEXT : PS_SKIPTAG;
|
||||
state = *ptr == '>' ? PS_TEXT : PS_SKIPTAG;
|
||||
} else {
|
||||
if (*ptr == '>') {
|
||||
if (!tagHandler(currentTag)) {
|
||||
|
@ -260,11 +260,11 @@ void HtmlReader::readDocument(ZLInputStream &stream) {
|
|||
}
|
||||
break;
|
||||
case PS_ATTRIBUTENAME:
|
||||
if ((*ptr == '>') || (*ptr == '/') || (*ptr == '=') || isspace((unsigned char)*ptr)) {
|
||||
if ((ptr != start) || !currentString.empty()) {
|
||||
if (*ptr == '>' || *ptr == '/' || *ptr == '=' || std::isspace((unsigned char)*ptr)) {
|
||||
if (ptr != start || !currentString.empty()) {
|
||||
currentString.append(start, ptr - start);
|
||||
for (unsigned int i = 0; i < currentString.length(); ++i) {
|
||||
currentString[i] = toupper(currentString[i]);
|
||||
currentString[i] = std::toupper(currentString[i]);
|
||||
}
|
||||
currentTag.addAttribute(currentString);
|
||||
currentString.erase();
|
||||
|
@ -300,8 +300,8 @@ void HtmlReader::readDocument(ZLInputStream &stream) {
|
|||
appendString(attributeValueString, currentString);
|
||||
state = PS_SPECIAL_IN_ATTRIBUTEVALUE;
|
||||
state_special = ST_UNKNOWN;
|
||||
} else if ((quotationCounter != 1) && ((*ptr == '>') || (*ptr == '/') || isspace((unsigned char)*ptr))) {
|
||||
if ((ptr != start) || !currentString.empty()) {
|
||||
} else if (quotationCounter != 1 && (*ptr == '>' || *ptr == '/' || std::isspace((unsigned char)*ptr))) {
|
||||
if (ptr != start || !currentString.empty()) {
|
||||
currentString.append(start, ptr - start);
|
||||
appendString(attributeValueString, currentString);
|
||||
if (attributeValueString[0] == '"') {
|
||||
|
|
|
@ -47,14 +47,14 @@ void NCXReader::startElementHandler(const char *fullTag, const char **attributes
|
|||
case READ_MAP:
|
||||
if (TAG_NAVPOINT == tag) {
|
||||
const char *order = attributeValue(attributes, "playOrder");
|
||||
myPointStack.push_back(NavPoint((order != 0) ? atoi(order) : myPlayIndex++, myPointStack.size()));
|
||||
myPointStack.push_back(NavPoint(order != 0 ? std::atoi(order) : myPlayIndex++, myPointStack.size()));
|
||||
myReadState = READ_POINT;
|
||||
}
|
||||
break;
|
||||
case READ_POINT:
|
||||
if (TAG_NAVPOINT == tag) {
|
||||
const char *order = attributeValue(attributes, "playOrder");
|
||||
myPointStack.push_back(NavPoint((order != 0) ? atoi(order) : myPlayIndex++, myPointStack.size()));
|
||||
myPointStack.push_back(NavPoint(order != 0 ? std::atoi(order) : myPlayIndex++, myPointStack.size()));
|
||||
} else if (TAG_NAVLABEL == tag) {
|
||||
myReadState = READ_LABEL;
|
||||
} else if (TAG_CONTENT == tag) {
|
||||
|
|
|
@ -236,7 +236,7 @@ bool RtfReader::parseDocument() {
|
|||
while (ptr != end) {
|
||||
switch (parserState) {
|
||||
case READ_END_OF_FILE:
|
||||
if (*ptr != '}' && !isspace(*ptr)) {
|
||||
if (*ptr != '}' && !std::isspace(*ptr)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -332,7 +332,7 @@ bool RtfReader::parseDocument() {
|
|||
case READ_HEX_SYMBOL:
|
||||
hexString += *ptr;
|
||||
if (hexString.size() == 2) {
|
||||
char ch = strtol(hexString.c_str(), 0, 16);
|
||||
char ch = std::strtol(hexString.c_str(), 0, 16);
|
||||
hexString.erase();
|
||||
processCharData(&ch, 1);
|
||||
parserState = READ_NORMAL_DATA;
|
||||
|
@ -340,7 +340,7 @@ bool RtfReader::parseDocument() {
|
|||
}
|
||||
break;
|
||||
case READ_KEYWORD:
|
||||
if (!isalpha(*ptr)) {
|
||||
if (!std::isalpha(*ptr)) {
|
||||
if (ptr == dataStart && keyword.empty()) {
|
||||
if (*ptr == '\'') {
|
||||
parserState = READ_HEX_SYMBOL;
|
||||
|
@ -352,7 +352,7 @@ bool RtfReader::parseDocument() {
|
|||
dataStart = ptr + 1;
|
||||
} else {
|
||||
keyword.append(dataStart, ptr - dataStart);
|
||||
if (*ptr == '-' || isdigit(*ptr)) {
|
||||
if (*ptr == '-' || std::isdigit(*ptr)) {
|
||||
dataStart = ptr;
|
||||
parserState = READ_KEYWORD_PARAMETER;
|
||||
} else {
|
||||
|
@ -365,9 +365,9 @@ bool RtfReader::parseDocument() {
|
|||
}
|
||||
break;
|
||||
case READ_KEYWORD_PARAMETER:
|
||||
if (!isdigit(*ptr)) {
|
||||
if (!std::isdigit(*ptr)) {
|
||||
parameterString.append(dataStart, ptr - dataStart);
|
||||
int parameter = atoi(parameterString.c_str());
|
||||
int parameter = std::atoi(parameterString.c_str());
|
||||
parameterString.erase();
|
||||
readNextChar = *ptr == ' ';
|
||||
if (keyword == "bin" && parameter > 0) {
|
||||
|
|
|
@ -133,7 +133,7 @@ void PlainTextFormatDetector::detect(ZLInputStream &stream, PlainTextFormat &for
|
|||
currentLineIndent = 0;
|
||||
} else if (*ptr == '\r') {
|
||||
continue;
|
||||
} else if (isspace((unsigned char)*ptr)) {
|
||||
} else if (std::isspace((unsigned char)*ptr)) {
|
||||
if (currentLineIsEmpty) {
|
||||
++currentLineIndent;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ bool TxtBookReader::characterDataHandler(std::string &str) {
|
|||
const char *ptr = str.data();
|
||||
const char *end = ptr + str.length();
|
||||
for (; ptr != end; ++ptr) {
|
||||
if (isspace((unsigned char)*ptr)) {
|
||||
if (std::isspace((unsigned char)*ptr)) {
|
||||
if (*ptr != '\t') {
|
||||
++mySpaceCounter;
|
||||
} else {
|
||||
|
|
|
@ -81,7 +81,7 @@ std::string MiscUtil::decodeHtmlURL(const std::string &encoded) {
|
|||
if ((encoded[i] == '%') && (i < len - 2)) {
|
||||
buffer[0] = *(encoded.data() + i + 1);
|
||||
buffer[1] = *(encoded.data() + i + 2);
|
||||
decoded += (char)strtol(buffer, 0, 16);
|
||||
decoded += (char)std::strtol(buffer, 0, 16);
|
||||
i += 2;
|
||||
} else {
|
||||
decoded += encoded[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue