- lyxerr[Debug::LYXVC] << "LyXVC: This file is a VC file." << endl;
-
- LyXLex lex(0, 0);
- lex.setFile(master);
-
- string token;
- bool read_enough = false;
- while (lex.IsOK() && !read_enough) {
- lex.next();
- token = lex.GetString();
-
- lyxerr[Debug::LYXVC] <<"LyXVC::scanMaster: current lex text: `"
- << token << "'" << endl;
-
- if (token.empty())
- continue;
- else if (token == "head") {
- // get version here
- lex.next();
- string tmv = strip(lex.GetString(), ';');
- version = tmv;
- } else if (contains(token, "access")
- || contains(token, "symbols")
- || contains(token, "strict")) {
- // nothing
- } else if (contains(token, "locks")) {
- // get locker here
- if (contains(token, ";")) {
- locker = "Unlocked";
- vcstat = UNLOCKED;
- continue;
- }
- string tmpt, s1, s2;
- do {
- lex.next();
- s1 = strip(tmpt = lex.GetString(), ';');
- // tmp is now in the format <user>:<version>
- s1 = split(s1, s2, ':');
- // s2 is user, and s1 is version
- if (s1 == version) {
- locker = s2;
- vcstat = LOCKED;
- break;
- }
- } while (!contains(tmpt, ";"));
-
- } else if (token == "comment") {
- // we don't need to read any further than this.
- read_enough = true;
- } else {
- // unexpected
- lyxerr[Debug::LYXVC]
- << "LyXVC::scanMaster(): unexpected token"
- << endl;
- }
- }
-}
-
-
-void LyXVC::setBuffer(Buffer *buf)
-{
- _owner = buf;