Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
ispeller_rep Struct Reference
Inheritance diagram for ispeller_rep:
Inheritance graph
[legend]
Collaboration diagram for ispeller_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ispeller_rep (string lan)
string start ()
string retrieve ()
void send (string cmd)

Public Attributes

string lan
tm_link ln
string res_name

Detailed Description

Definition at line 28 of file ispell.cpp.


Constructor & Destructor Documentation

Definition at line 44 of file ispell.cpp.

: rep<ispeller> (lan2), lan (lan2) {}

Member Function Documentation

Definition at line 85 of file ispell.cpp.

                        {
  string ret;
#if defined (__MINGW__) || defined (__MINGW32__)
  while ((ret != "\r\n") && (!ends (ret, "\r\n\r\n")) &&
        ((!ends (ret, "\r\n")) || (!starts (ret, "@(#)"))))
#else
  while ((ret != "\n") && (!ends (ret, "\n\n")) &&
        ((!ends (ret, "\n")) || (!starts (ret, "@(#)"))))
#endif
    {
      ln->listen (10000);
      string mess = ln->read (LINK_ERR);
      string extra= ln->read (LINK_OUT);
      if (mess  != "") cerr << "TeXmacs] ispell error: " << mess << "\n";
      if (extra == "") {
       ln->stop ();
       return "Error: ispell does not respond";
      }
      ret << extra;
    }
  return ispell_decode (lan, ret);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ispeller_rep::send ( string  cmd)

Definition at line 109 of file ispell.cpp.

                              {
  ln->write (ispell_encode (lan, cmd) * "\n", LINK_IN);
}

Here is the call graph for this function:

Definition at line 47 of file ispell.cpp.

                     {
  if (is_nil (ln)) {
    string cmd;
#ifdef OS_WIN32
    string prg= "\"$TEXMACS_PATH/bin/aspell/aspell.exe\"";
    cmd= prg * " --data-dir=.%//data --dict-dir=.%//dict -a";
#else
    if (exists_in_path ("aspell")) cmd= "aspell";
    else
#if defined (__MINGW__) || defined (__MINGW32__)
      if (exists (url_system ("C:\\Program Files\\Aspell\\bin\\aspell.exe")))
        cmd= "\"C:\\Program Files\\Aspell\\bin\\aspell.exe\"";
      else
#endif
        cmd= "ispell";
    cmd << " -a -d " * ispell_dictionary (lan) * ispell_extra_args (lan);
#endif
    ln= make_pipe_link (cmd);
  }
  if (ln->alive) return "ok";
  string message= ln->start ();
  if (DEBUG_IO) cout << "Ispell] Received " << message << "\n";
  if (starts (message, "Error: ")) {
    if (ln->alive) ln->stop ();
    return message;
  }
  message= retrieve ();
  if (DEBUG_IO) cout << "Ispell] Received " << message << "\n";
#ifdef OS_WIN32
  if (search_forwards (message, 0, "@(#)")) return "ok";
#else
  if (starts (message, "@(#)")) return "ok";
#endif
  if (ln->alive) ln->stop ();
  return "Error: no dictionary for#" * lan;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 29 of file ispell.cpp.

Definition at line 30 of file ispell.cpp.

string rep< ispeller >::res_name [inherited]

Definition at line 17 of file resource.hpp.


The documentation for this struct was generated from the following file: