Если без регулярных выражений, то можно так:
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#define PATH "document.json"
int main() {
std::vector<std::string> v;
std::ifstream fin(PATH);
if (
fin.is _open()) {
try {
std::string str;
while (std::getline(fin, str)) {
size_t it1 = 0;
size_t it2 = 0;
it1 = str.find('\"', it1);
it2 = str.find('\"', it1 + 1);
if (it1 != std::string::npos && it2 != std::string::npos) {
std::string word = str.substr(it1 + 1, (it2 - it1) - 1);
v.push_back(word);
}
}
}
catch (const std::exception& e) {
printf("Error: %s\n", e.what());
}
}
fin.close();
for (auto& it : v)
std::cout << it << std::endl;
return 0;
}
"Oh why lament its fall",
"some words..",
"silicate mineral content"
]