Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6690


Ignore:
Timestamp:
Apr 12, 2010, 3:30:51 PM (14 years ago)
Author:
smerkli
Message:

Few changes before the questions, completing doxy stuff.

Location:
code/branches/chat/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/chat/src/orxonox/ChatHistory.cc

    r6688 r6690  
    3333{
    3434#endif
     35  /* QUESTION */
    3536  /* is this necessary? if yes uncomment please :P */
    3637  //CreateFactory(ChatHistory);
     
    6768    chat_hist_closelog();
    6869   
    69     /* TODO clear list */
     70    /* clear list */
     71    this->hist_buffer.clear();
    7072  }
    7173
     
    7476    unsigned int senderID)
    7577  {
     78    /* QUESTION */
    7679    /* sanity - check for valid senderID */
    77     /* sanity - check for valid string format */
    7880
    79     /* format the message and senderID into a line */
    80     std::string buf = "" + senderID; /* NOTE to be changed */
     81    /* TODO make a correct name */
     82    std::string name = "" + senderID; /* NOTE to be changed */
    8183
    8284    /* TODO */
     85    /* QUESTION */
    8386    /* --> a) look up the actual name of the sender */
    8487    /* --> b) add sender name and string up with a separator
     
    8790
    8891    /* add the line to the history */
    89     this->chat_hist_addline( buf + ": " + message );
     92    this->chat_hist_addline( name + ": " + message );
    9093
    9194    /* add the line to the log */
    92     this->chat_hist_logline( buf + ": " + message );
     95    this->chat_hist_logline( name + ": " + message );
    9396  }
    9497
     
    109112    /* push to the front of the history */
    110113    this->hist_buffer.push_back( toadd );
    111 
    112114  }
    113115
     
    115117  int ChatHistory::chat_hist_logline( const std::string& toadd )
    116118  {
    117     /* TODO use already written class to batch write to file
    118      * so not every line gets written on its own
    119      */
    120119    /* output the line to the file if logging is enabled */
    121120    if( this->hist_log_enabled )
     
    126125  int ChatHistory::chat_hist_openlog()
    127126  {
     127    /* QUESTION */
    128128    /* TODO: find out the name of the file to log to via settings
    129129     *       and set the this->hist_logfile_path variable to it
     
    132132      std::fstream::out | std::fstream::app );
    133133
     134    /* QUESTION */
    134135    /* TODO check whether this works (not sure how you'd like it?) */
    135136
     
    150151  void ChatHistory::debug_printhist()
    151152  {
     153    /* create deque iterator */
    152154    std::deque<std::string>::iterator it;
    153155
     156    /* output all the strings */
    154157    for( it = this->hist_buffer.begin(); it != this->hist_buffer.end();
    155158      ++it )
    156159      std::cout << *it << std::endl;
    157160
     161    /* output size */
    158162    std::cout << "Size: " << hist_buffer.size() << std::endl;
    159 
    160    
    161163  }
    162164
  • code/branches/chat/src/orxonox/ChatHistory.h

    r6688 r6690  
    3232#include <iostream>
    3333
     34/* define this if you're unit testing */
    3435#define TEST 0
    3536
     
    8081      int syncLog();
    8182
    82       /** debug-print */
     83      /** debug-print: output the whole history to stdout */
    8384      void debug_printhist();
    8485     
     
    133134#endif
    134135
    135 
    136136#endif /* _ChatHistory_H__ */
Note: See TracChangeset for help on using the changeset viewer.