Back to index

texmacs  1.0.7.15
Functions
properties.cpp File Reference
#include "tmfs.hpp"

Go to the source code of this file.

Functions

strings seq (string s1)
strings seq (string s1, string s2)
strings seq (string s1, string s2, string s3)
strings seq (string s1, string s2, string s3, string s4)
property_quote(property p)
property_unquote(property p)
string 
property_append (property p)
property_unappend(string s) string properties_encode (properties ps)
properties properties_decode (string s)
bool matches (property p, property q)
properties reset (properties ps, property p)
substitute(property p, string
what, string by) properties 
substitute (properties ps, string what, string by)
substitute(property p,
solution sol) properties 
substitute (property p, solutions sols)
properties exclude_types (properties ps, collection c)
properties widen (properties ps)

Function Documentation

Definition at line 187 of file properties.cpp.

                                            {
  properties r;
  for (int i=0; i<N(ps); i++)
    if (N(ps[i])>0 && !c->contains (ps[i][0]))
      r << ps[i];
  return r;
}

Here is the call graph for this function:

bool matches ( property  p,
property  q 
)

Definition at line 117 of file properties.cpp.

                                 {
  if (N(p) != N(q)) return false;
  solution sol;
  for (int i=0; i<N(p); i++)
    if (is_unknown (q[i])) {
      if (!sol->contains (q[i])) sol(q[i])= p[i];
      else if (sol[q[i]] != p[i]) return false;
    }
    else if (q[i] != p[i]) return false;
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 102 of file properties.cpp.

                             {
  properties ps;
  for (int i=0; i<N(s); i++) {
    int start= i;
    while (i<N(s) && s[i] != '\n') i++;
    ps << property_unquote (property_unappend (s (start, i)));
  }
  return ps;
}

Here is the call graph for this function:

Here is the caller graph for this function:

property_unappend( string s) string properties_encode ( properties  ps)

Definition at line 94 of file properties.cpp.

                                  {
  string r;
  for (int i=0; i<N(ps); i++)
    r << property_append (property_quote (ps[i])) << '\n';
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

property_quote( property p) property_unquote( property p) string property_append ( property  p)

Definition at line 71 of file properties.cpp.

                             {
  if (N(p) == 0) return "";
  string r= copy (p[0]);
  for (int i=1; i<N(p); i++) r << ',' << p[i];
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 130 of file properties.cpp.

                                  {
  properties r;
  for (int i=0; i<N(ps); i++)
    if (!matches (ps[i], p))
      r << ps[i];
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

strings seq ( string  s1)

Definition at line 19 of file properties.cpp.

                {
  strings a; a << s1; return a;
}

Here is the caller graph for this function:

strings seq ( string  s1,
string  s2 
)

Definition at line 24 of file properties.cpp.

                           {
  strings a; a << s1 << s2; return a;
}
strings seq ( string  s1,
string  s2,
string  s3 
)

Definition at line 29 of file properties.cpp.

                                      {
  strings a; a << s1 << s2 << s3; return a;
}
strings seq ( string  s1,
string  s2,
string  s3,
string  s4 
)

Definition at line 34 of file properties.cpp.

                                                 {
  strings a; a << s1 << s2 << s3 << s4; return a;
}
substitute( property p, string what, string by) properties substitute ( properties  ps,
string  what,
string  by 
)

Definition at line 158 of file properties.cpp.

                                                   {
  properties qs;
  for (int i=0; i<N(ps); i++)
    qs << substitute (ps[i], what, by);
  return qs;
}

Here is the call graph for this function:

Definition at line 175 of file properties.cpp.

                                        {
  properties r;
  for (int i=0; i<N(sols); i++)
    r << substitute (p, sols[i]);
  return r;
}

Here is the call graph for this function:

Definition at line 196 of file properties.cpp.

                      {
  properties r;
  for (int i=0; i<N(ps); i++) {
    property c= copy (ps[i]);
    if (N(c) > 0) c[N(c)-1]= "?any";
    r << c;
  }
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function: