<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki.lostsouls.org/w/skins/common/feed.css"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.lostsouls.org/w/index.php?action=history&amp;feed=atom&amp;title=Man_case_pattern</id>
		<title>Man case pattern - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.lostsouls.org/w/index.php?action=history&amp;feed=atom&amp;title=Man_case_pattern"/>
		<link rel="alternate" type="text/html" href="http://wiki.lostsouls.org/w/index.php?title=Man_case_pattern&amp;action=history"/>
		<updated>2026-04-26T09:54:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.8.2</generator>

	<entry>
		<id>http://wiki.lostsouls.org/w/index.php?title=Man_case_pattern&amp;diff=3956&amp;oldid=prev</id>
		<title>Laine at 19:22, 11 June 2007</title>
		<link rel="alternate" type="text/html" href="http://wiki.lostsouls.org/w/index.php?title=Man_case_pattern&amp;diff=3956&amp;oldid=prev"/>
				<updated>2007-06-11T19:22:31Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Files==&lt;br /&gt;
 /def/descriptor/case_pattern.c&lt;br /&gt;
 /lib/descriptors/case_pattern.h&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
Case pattern descriptors implement a mechanism that allows you to abstract&lt;br /&gt;
the pattern of upper and lower case letters from a string, manipulate it in&lt;br /&gt;
lower-case, and then restore the original case pattern when you are done.&lt;br /&gt;
The way this usually goes is like so:&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;case_pattern.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  string text = get_some_text();&lt;br /&gt;
  descriptor pat = Case_Pattern_Extract(&amp;amp;text);&lt;br /&gt;
  text = transform_the_text_in_various_ways(text);&lt;br /&gt;
  text = Case_Pattern_Restore(text, pat);&lt;br /&gt;
&lt;br /&gt;
Note that the argument to Case_Pattern_Extract() is being passed by&lt;br /&gt;
reference.  This causes it to be converted to lower-case.  You do not have&lt;br /&gt;
to pass the argument by reference if you do not want it to be converted to&lt;br /&gt;
lower-case.&lt;br /&gt;
&lt;br /&gt;
This is usually all you need to know about the mechanism; the fields of&lt;br /&gt;
the descriptor and so forth are all managed internally.  The remainder of&lt;br /&gt;
this document is provided for reference purposes.&lt;br /&gt;
&lt;br /&gt;
===Public Fields===&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type: The type of the case pattern.  This is one of the&lt;br /&gt;
following:&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_Indeterminate: No representable case pattern was&lt;br /&gt;
found in the original text.  This generally means the original text&lt;br /&gt;
contained no letters.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_All_Upper: All letters in the original text were&lt;br /&gt;
upper-case.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_All_Lower: All letters in the original text were&lt;br /&gt;
lower-case.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_First_Upper: The first letter in the original text&lt;br /&gt;
was upper-case and the remainder were lower-case.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_First_Lower: The first letter in the original text&lt;br /&gt;
was lower-case and the remainder were upper-case.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_Words_Upper: The original text had a capital letter&lt;br /&gt;
at the beginning of each word, as if it were the output of the call&lt;br /&gt;
capitalize_words(some_text).&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_Main_Words_Upper: The original text had a capital&lt;br /&gt;
letter at the beginning of each word, as if it were the output of the&lt;br /&gt;
call capitalize_words(some_text, True).&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Type_Complex: The original text had a complex case&lt;br /&gt;
pattern, as specified in the Case_Pattern_Content field.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Original: The original text the case pattern is based on.&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Altered: The text with the case pattern extracted (converted&lt;br /&gt;
to lower-case).&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Content: For Case_Pattern_Type_Complex patterns, an array&lt;br /&gt;
describing the case pattern in the original text.  Each element will be&lt;br /&gt;
either Case_Pattern_Element_Upper, Case_Pattern_Element_Lower, or&lt;br /&gt;
Case_Pattern_Neither, corresponding to one letter in the original text.&lt;br /&gt;
&lt;br /&gt;
===Internal Fields===&lt;br /&gt;
&lt;br /&gt;
Case_Pattern_Tag: The tag value for the descriptor system.&lt;br /&gt;
&lt;br /&gt;
===Support Functions===&lt;br /&gt;
&lt;br /&gt;
'''descriptor Case_Pattern_Extract(string text)'''&lt;br /&gt;
&lt;br /&gt;
Extracts the case pattern from the specified text and returns it.  If&lt;br /&gt;
the text is passed by reference, it will be converted to lower-case.&lt;br /&gt;
&lt;br /&gt;
'''string Case_Pattern_Restore(string text, descriptor dxr)'''&lt;br /&gt;
&lt;br /&gt;
Coerces the specified text into the case pattern described by the&lt;br /&gt;
descriptor passed and returns the result.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[man lower case|lower_case(efun)]], [[man upper case|upper_case(efun)]], [[man capitalize|capitalize(efun)]], [[man capitalize words|capitalize_words(sefun)]], [[man descriptors|descriptors(mechanisms)]]&lt;/div&gt;</summary>
		<author><name>Laine</name></author>	</entry>

	</feed>