//then assign each NavNode a list of file#id values //a NavPoint's range is from its contentHref until the next NavPoint's contentHref //a PageTarget's range is from its contentHref until the next PageTarget's contentHref //what is hard to tell: ranges for nav list items (so for now just give them one file#id //when we have dtbook support, this info can come from smilref attributes bool amis::dtb::nav::ResolveSmilDataVisitor::preVisit(NavNode* pNode) { if (mThreadYielder != 0) mThreadYielder->peekAndPump(); //ranges aren't supported in nav targets yet if (pNode != NULL && pNode->getTypeOfNode() == NavNode::NAV_TARGET) { addToMap(pNode->getContent(), pNode); } else { if (mpPreviousNavNode != NULL) { string c1 = mpPreviousNavNode->getContent(); string c2; if (pNode == NULL) c2 = ""; else c2 = pNode->getContent(); //this will be the range for the previous nav point StdStringList range; range = getRange(c1, c2); for (int i = 0; i<range.size(); i++) { addToMap(range[i], mpPreviousNavNode); } } mpPreviousNavNode = pNode; } return true; }
StdStringList HttpContext::GetHeaderNames() const { StdStringList headerNames; for ( const auto& pair : _headers ) { headerNames.push_back(pair.first); } return headerNames; }
void HttpContext::ParseStdStringList(const StdStringList &stringList) { for ( const std::string& line : stringList ) { StdStringList words = SplitString(line, ':'); if ( !words.size() ) { return; } std::string headerName = words[0]; std::string headerValue = words[1]; if ( words.size() > 2 ) { for ( int wordIndex = 2; wordIndex < words.size(); ++ wordIndex ) { headerValue += ':'; headerValue += words[wordIndex]; } } headerValue.erase(headerValue.begin()); SetHeader(headerName, headerValue); } }