Skip to content
Snippets Groups Projects
Commit ab606f03 authored by Nicholas Yang's avatar Nicholas Yang
Browse files

still not complete - needs to check every docending chunk in seek

it gets the closest one
parent 5f76bc99
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -70,6 +70,7 @@ void ISREndDoc::seek(Location target) {
int currentValueChunk = 0;
bool found = false;
pair<size_t, size_t> docEndingWordSeek; // location, offset
size_t tempLocation;
string input = "";
while(!found) {
string fileName = util::GetCurrentWorkingDir() +
......@@ -84,18 +85,18 @@ void ISREndDoc::seek(Location target) {
for(auto comp : value) {
switch(comp) {
case '<':
docEndingWordSeek = pair<size_t, size_t>();
break;
case '>':
if(target < tempLocation && target > docEndingWordSeek.first) {
found = true;
break;
}
docEndingWordSeek.first = tempLocation;
docEndingWordSeek.second = stoll(input);
input = "";
break;
case ',':
if(target < stoll(input) && target > docEndingWordSeek.first) {
found = true;
break;
}
docEndingWordSeek.first = stoll(input);
tempLocation = stoll(input);
input = "";
break;
default:
......
......@@ -4,6 +4,6 @@ using namespace std;
int main() {
ISREndDoc endDoc;
endDoc.seek(1000);
endDoc.seek(4000);
cout << endDoc.next().docEndPosition << endl;
}
\ No newline at end of file
#!/bin/bash
cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl/ -DOPENSSL_LIBRARIES=/usr/local/ssl/lib/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment