Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get list of C++ class names from source code

How to get list of C++ class names from source code

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pandit84
    wrote on last edited by
    #1

    How to get list of C++ class name from source code. I have created few sequence and class diagram using EA tool which I need to verify. I tried to use sourcmonitor tool but it gives only number of classes in a particular source file. But does not generate any class name list.

    D 1 Reply Last reply
    0
    • P pandit84

      How to get list of C++ class name from source code. I have created few sequence and class diagram using EA tool which I need to verify. I tried to use sourcmonitor tool but it gives only number of classes in a particular source file. But does not generate any class name list.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Some pseudocode to get you started:

      Open .h file
      Repeat
      Read line from file
      If line starts with "class ", next word is class name
      Until EOF
      Close file

      There may be some situations where this might not work.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      S 1 Reply Last reply
      0
      • D David Crow

        Some pseudocode to get you started:

        Open .h file
        Repeat
        Read line from file
        If line starts with "class ", next word is class name
        Until EOF
        Close file

        There may be some situations where this might not work.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        S Offline
        S Offline
        Sivaraman Dhamodharan
        wrote on last edited by
        #3

        Ha Ha!! Up voted Man!

        Programming Article

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups