+#endif
+bool ReadLinesFromFile(string sPathName, vector<string>& vLine)
+{
+ vLine.clear();
+ FILE *file = fopen(sPathName.c_str(), "rb");
+ if (file != NULL)
+ {
+ unsigned int len = GetFileLen(file);
+ char* data = new char[len + 1];
+ fread(data, 1, len, file);
+ data[len] = '\0';
+ string content = data;
+ content += "\n";
+ delete data;
+
+ unsigned int i;
+ for (i = 0; i < content.size(); i++)
+ {
+ if (content[i] == '\r')
+ content[i] = '\n';
+ }
+
+ int n;
+ while ((n = content.find("\n", 0)) != -1)
+ {
+ string line = content.substr(0, n);
+ line = TrimString(line);
+ if (line != "")
+ vLine.push_back(line);
+ content = content.substr(n + 1);
+ }
+
+ fclose(file);
+ }
+ else
+ return false;
+
+ return true;
+}
+