1. Marijn van der Zee
  2. sphinx

Commits

mitsuhiko  committed fee603a

Fixed a bug in the C++ domain and documented more

  • Participants
  • Parent commits 2401963
  • Branches default

Comments (0)

Files changed (2)

File doc/domains.rst

View file
                .. cpp:type:: signatures
 
    Describe a C++ object.  Full signature specification is supported -- give the
-   signature as you would in the declaration.  Example::
+   signature as you would in the declaration.  Here some examples::
 
-      .. cpp:function:: const T &Array<T>::operator[]() const
+      .. cpp:function:: bool namespaced::theclass::method(int arg1, std::string arg2)
+
+         Describes a method with parameters and types.
+
+      .. cpp:function:: bool namespaced::theclass::method(arg1, arg2)
+
+         Describes a method without types.
+
+      .. cpp:function:: const T &array<T>::operator[]() const
 
          Describes the constant indexing operator of a templated array.
 
+      .. cpp:function:: operator bool() const
+
+         Describe a casting operator here.
+
+      .. cpp:member:: std::string theclass::name
+
+      .. cpp:type:: theclass::const_iterator
+
+   Will be rendered like this:
+
+      .. cpp:function:: bool namespaced::theclass::method(int arg1, std::string arg2)
+
+         Describes a method with parameters and types.
+
+      .. cpp:function:: bool namespaced::theclass::method(arg1, arg2)
+
+         Describes a method without types.
+
+      .. cpp:function:: const T &array<T>::operator[]() const
+
+         Describes the constant indexing operator of a templated array.
+
+      .. cpp:function:: operator bool() const
+
+         Describe a casting operator here.
+
+      .. cpp:member:: std::string theclass::name
+
+      .. cpp:type:: theclass::const_iterator
+
 .. rst:directive:: .. cpp:namespace:: namespace
 
    Select the current C++ namespace for the following objects.

File sphinx/domains/cpp.py

View file
         return self.name.get_name()
 
     def get_id(self):
+        if self.type is None:
+            return 'X'
         return self.type.get_id()
 
     def __unicode__(self):