C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Using rope - a STL container


Posted Date: 18 Jun 2008    Resource Type: Code Snippets    Category: String Manipulations
Author: Lekshmi m nairMember Level: Silver    
Rating: Points: 6



Rope is a non-Standard STL container. It is used to manipulate huge string data. Operations such as assignment, concatenation and sub string are very fast in rope, independent of the length of string. Rope is not keeping the huge strings are contiguous allocation. Instead its splits and keeps the same, which makes these, types of operations faster.

The code samples that follow are examples on how to use rope. The examples are in C++ and display how to use Rope for constructing, concatenating, getting substrings from strings.


// Rope is crope.
std::crope MyRope( 1000000, 'x' ); // A million chars with 'x'



// Concatination.
std::crope MyRope2 = MyRope + "abc" + MyRope;



// Getting Substring
std::crope MyRope3 = MyRope2.substr(1000000, 3);


But rope is not suitable for traversing char by char, which is very slow. If you need fast substr like operation in a huge string, rope is preferable. But take care, this rope is not the part of Standard STL library. If you are using STLPort, rope will be available in your system. If you are strict to standards, rope will disappoint you.





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Using rope  .  Uses of rope  .  Rope examples  .  Rope drawbacks  .  Rope a stl container  .  Rope a non-standard stl container  .  Rope  .  Disadvantages of rope  .  Advantages of rope  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Convert a String to ASCII
Previous Resource: Substring Function in Sql Server
Return to Discussion Resource Index
Post New Resource
Category: String Manipulations


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use