C/C++ Code Syntax Highlighting

Reply

Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Using isspace with white spaces

 
0
  #1
Nov 17th, 2006
Originally Posted by ~s.o.s~ View Post
If you use C++ strings your life would be much simpler coz then you can do something like:

  1. #include <string>
  2.  
  3. const std::string whiteSpaces( " \f\n\r\t\v" );
  4.  
  5. void trimRight( std::string& str,
  6. const std::string& trimChars = whiteSpaces )
  7. {
  8. std::string::size_type pos = str.find_last_not_of( trimChars );
  9. str.erase( pos + 1 );
  10.  
  11. }
  12.  
  13.  
  14. void trimLeft( std::string& str,
  15. const std::string& trimChars = whiteSpaces )
  16. {
  17. std::string::size_type pos = str.find_first_not_of( trimChars );
  18. str.erase( 0, pos );
  19. }
  20.  
  21.  
  22. void trim( std::string& str, const std::string& trimChars = whiteSpaces )
  23. {
  24. trimRight( str, trimChars );
  25. trimLeft( str, trimChars );
  26. }
Is it just me or is dat syntax highlighting really bad. That bright blue is annoying. Yucky.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,652
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Using isspace with white spaces

 
0
  #2
Nov 17th, 2006
Originally Posted by iamthwee View Post
Is it just me or is dat syntax highlighting really bad. That bright blue is annoying. Yucky.
Ditto here, it makes my eyes hurt. Dont know how this color got approved.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Using isspace with white spaces

 
0
  #3
Nov 17th, 2006
Originally Posted by ~s.o.s~ View Post
Ditto here, it makes my eyes hurt. Dont know how this color got approved.
I don't know, perhaps you can ask dani to change it?
In fact it wouldn't be such a bad idea if it were got rid off altogether. Hmm, oh well.
Last edited by iamthwee; Nov 17th, 2006 at 2:26 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Using isspace with white spaces

 
0
  #4
Nov 17th, 2006
Originally Posted by iamthwee View Post
I don't know, perhaps you can ask dani to change it?
In fact it wouldn't be such a bad idea if it were got rid off altogether. Hmm, oh well.
I have. No support.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,652
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Using isspace with white spaces

 
0
  #5
Nov 17th, 2006
Originally Posted by iamthwee View Post
I don't know, perhaps you can ask dani to change it?
Naa already have asked alot of things from Miss Dani. Keep bugging here everyday with this and that... One more request and I surely would put her in rage mode.

Originally Posted by WaltP View Post
I have. No support.
Was the suggestion via a PM ? IF so how are we supposed to support you? No thread as such related to C++ color schemes.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Using isspace with white spaces

 
0
  #6
Nov 18th, 2006
Originally Posted by ~s.o.s~ View Post
Was the suggestion via a PM ? IF so how are we supposed to support you? No thread as such related to C++ color schemes.
No. http://www.daniweb.com/techtalkforums/thread59169.html
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,652
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Using isspace with white spaces

 
0
  #7
Nov 18th, 2006
Originally Posted by WaltP View Post
No. http://www.daniweb.com/techtalkforums/thread59169.html
But Miss Dani didnt even reply in that thread. So whats the point in supporting when she didnt comment on your effort ? Maybe she is fed up of too many suggestions or maybe a lot of money has gone into it to change it or maybe the cost or some more hidden reason.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Using isspace with white spaces

 
0
  #8
Nov 18th, 2006
Gentlemen, let's continue this in the Community Feedback forum shall we?I am moving the posts regarding the syntax highlighting to a new thread.
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: C/C++ Code Syntax Highlighting

 
0
  #9
Nov 18th, 2006
You guys should be using code=cplusplus instead of code=cpp.

#include <string> 
 
const std::string whiteSpaces( " \f\n\r\t\v" ); 
 
void trimRight( std::string& str, 
const std::string& trimChars = whiteSpaces ) 
{ 
     std::string::size_type pos = str.find_last_not_of( trimChars ); 
     str.erase( pos + 1 ); 
} 
 
 
void trimLeft( std::string& str, 
const std::string& trimChars = whiteSpaces ) 
{ 
     std::string::size_type pos = str.find_first_not_of( trimChars ); 
     str.erase( 0, pos ); 
} 
 
 
void trim( std::string& str, const std::string& trimChars = whiteSpaces ) 
{ 
     trimRight( str, trimChars ); 
     trimLeft( str, trimChars ); 
}
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: C/C++ Code Syntax Highlighting

 
0
  #10
Nov 18th, 2006
Originally Posted by cscgal View Post
You guys should be using code=cplusplus instead of code=cpp.

#include <string> 
 
const std::string whiteSpaces( " \f\n\r\t\v" ); 
 
void trimRight( std::string& str, 
const std::string& trimChars = whiteSpaces ) 
{ 
     std::string::size_type pos = str.find_last_not_of( trimChars ); 
     str.erase( pos + 1 ); 
} 
 
 
void trimLeft( std::string& str, 
const std::string& trimChars = whiteSpaces ) 
{ 
     std::string::size_type pos = str.find_first_not_of( trimChars ); 
     str.erase( 0, pos ); 
} 
 
 
void trim( std::string& str, const std::string& trimChars = whiteSpaces ) 
{ 
     trimRight( str, trimChars ); 
     trimLeft( str, trimChars ); 
}
Ha ha, silly SOS and his typos. Dearie me.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the DaniWeb Community Feedback Forum


Views: 6244 | Replies: 17
Thread Tools Search this Thread



Tag cloud for DaniWeb Community Feedback
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC