diff libinterp/parse-tree/comment-list.h @ 23750:ea879bc55272

move comment_list and comment_elt classes to octave namespace * comment-list.h, comment-list.cc (class comment_list, class comment_elt): Move inside octave namespace and rename from octave_coment_list and octave_comment_elt. Change all uses.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Jul 2017 18:43:32 -0400
parents 6921d8458203
children 194eb4bd202b
line wrap: on
line diff
--- a/libinterp/parse-tree/comment-list.h	Fri Jul 07 18:17:32 2017 -0400
+++ b/libinterp/parse-tree/comment-list.h	Fri Jul 07 18:43:32 2017 -0400
@@ -29,75 +29,88 @@
 
 #include "base-list.h"
 
-extern std::string get_comment_text (void);
-
-extern char * get_comment_text_c_str (void);
-
-extern void save_comment_text (const std::string& text);
-
-class
-octave_comment_elt
+namespace octave
 {
-public:
+  extern std::string get_comment_text (void);
+
+  extern char * get_comment_text_c_str (void);
 
-  enum comment_type
+  extern void save_comment_text (const std::string& text);
+
+  class
+  comment_elt
   {
-    unknown,
-    block,
-    full_line,
-    end_of_line,
-    doc_string,
-    copyright
+  public:
+
+    enum comment_type
+      {
+        unknown,
+        block,
+        full_line,
+        end_of_line,
+        doc_string,
+        copyright
+      };
+
+    comment_elt (const std::string& s = "",
+                        comment_type t = unknown)
+      : txt (s), typ (t) { }
+
+    comment_elt (const comment_elt& oc)
+      : txt (oc.txt), typ (oc.typ) { }
+
+    comment_elt& operator = (const comment_elt& oc)
+    {
+      if (this != &oc)
+        {
+          txt = oc.txt;
+          typ = oc.typ;
+        }
+
+      return *this;
+    }
+
+    std::string text (void) const { return txt; }
+
+    comment_type type (void) const { return typ; }
+
+    ~comment_elt (void) = default;
+
+  private:
+
+    // The text of the comment.
+    std::string txt;
+
+    // The type of comment.
+    comment_type typ;
   };
 
-  octave_comment_elt (const std::string& s = "",
-                      comment_type t = unknown)
-    : txt (s), typ (t) { }
-
-  octave_comment_elt (const octave_comment_elt& oc)
-    : txt (oc.txt), typ (oc.typ) { }
-
-  octave_comment_elt& operator = (const octave_comment_elt& oc)
+  class
+  comment_list : public octave::base_list<comment_elt>
   {
-    if (this != &oc)
-      {
-        txt = oc.txt;
-        typ = oc.typ;
-      }
+  public:
 
-    return *this;
-  }
+    comment_list (void) { }
 
-  std::string text (void) const { return txt; }
-
-  comment_type type (void) const { return typ; }
-
-  ~octave_comment_elt (void) = default;
+    void append (const comment_elt& elt)
+    { octave::base_list<comment_elt>::append (elt); }
 
-private:
+    void append (const std::string& s,
+                 comment_elt::comment_type t = comment_elt::unknown)
+    { append (comment_elt (s, t)); }
 
-  // The text of the comment.
-  std::string txt;
-
-  // The type of comment.
-  comment_type typ;
-};
+    comment_list * dup (void) const;
+  };
+}
 
-class
-octave_comment_list : public octave::base_list<octave_comment_elt>
-{
-public:
-
-  octave_comment_list (void) { }
+#if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
 
-  void append (const octave_comment_elt& elt)
-  { octave::base_list<octave_comment_elt>::append (elt); }
+OCTAVE_DEPRECATED (4.4, "use 'octave::comment_list' instead")
+typedef octave::comment_list octave_comment_list;
 
-  void append (const std::string& s,
-               octave_comment_elt::comment_type t = octave_comment_elt::unknown)
-  { append (octave_comment_elt (s, t)); }
-
-  octave_comment_list * dup (void) const;
-};
+OCTAVE_DEPRECATED (4.4, "use 'octave::comment_elt' instead")
+typedef octave::comment_elt octave_comment_elt;
 
 #endif
+
+#endif