CWS-TOOLING: integrate CWS cmcfixes58
2009-05-04 13:51:10 +0200 cmc r271450 : #i101533# latest sw warnings 2009-05-04 00:02:46 +0200 cmc r271436 : #i101517# silence new warnings 2009-05-03 23:13:53 +0200 cmc r271435 : #i101305# add that one back in 2009-05-02 16:30:42 +0200 cmc r271431 : #i101493# get it to build, and remove some warnings 2009-05-02 16:12:37 +0200 cmc r271430 : CWS-TOOLING: rebase CWS cmcfixes58 to trunk@271427 (milestone: DEV300:m47) 2009-04-23 13:19:33 +0200 cmc r271163 : #i101305# remove annoying import foo is unused warnings 2009-04-21 17:10:34 +0200 cmc r271048 : #i101246# remove AVMEDIA_MANAGER_SERVICE_NAME defines again 2009-04-21 17:07:41 +0200 cmc r271047 : #i86323# remove xml2cmp unused methods
This commit is contained in:
parent
4758f1c283
commit
a9b42eca27
34 changed files with 1 additions and 601 deletions
|
@ -30,15 +30,8 @@
|
|||
package com.sun.star.comp;
|
||||
|
||||
import com.sun.star.lib.uno.helper.Factory;
|
||||
import com.sun.star.lang.XMultiComponentFactory;
|
||||
import com.sun.star.lang.XSingleComponentFactory;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.uno.Type;
|
||||
import com.sun.star.uno.Any;
|
||||
import com.sun.star.uno.AnyConverter;
|
||||
import com.sun.star.comp.juhtest.SmoketestCommandEnvironment;
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
package com.sun.star.comp.helper;
|
||||
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
import com.sun.star.bridge.UnoUrlResolver;
|
||||
import com.sun.star.bridge.XUnoUrlResolver;
|
||||
import com.sun.star.comp.loader.JavaLoader;
|
||||
|
@ -38,7 +37,6 @@ import com.sun.star.container.XSet;
|
|||
import com.sun.star.lang.XInitialization;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XMultiComponentFactory;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.lang.XSingleComponentFactory;
|
||||
import com.sun.star.lib.util.NativeLibraryLoader;
|
||||
import com.sun.star.loader.XImplementationLoader;
|
||||
|
|
|
@ -34,8 +34,6 @@ import com.sun.star.lib.uno.helper.WeakBase;
|
|||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.uno.Any;
|
||||
import com.sun.star.uno.AnyConverter;
|
||||
import com.sun.star.ucb.XCommandEnvironment;
|
||||
|
||||
/** This service is for use by the smoketest which checks the installation of
|
||||
|
|
|
@ -44,7 +44,6 @@ package com.sun.star.lib.uno.adapter;
|
|||
import com.sun.star.io.XInputStream;
|
||||
import com.sun.star.io.XSeekable;
|
||||
import com.sun.star.lib.uno.helper.ComponentBase;
|
||||
import java.io.*;
|
||||
|
||||
public class ByteArrayToXInputStreamAdapter
|
||||
extends ComponentBase
|
||||
|
|
|
@ -32,9 +32,6 @@ package com.sun.star.lib.uno.helper;
|
|||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.lang.XEventListener;
|
||||
import com.sun.star.lang.EventObject;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import com.sun.star.uno.Type;
|
||||
|
||||
/** This class can be used as the base class for UNO components. In addition to the functionality ,which
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
************************************************************************/
|
||||
|
||||
package com.sun.star.lib.uno.helper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Iterator;
|
||||
import java.util.ListIterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
@ -38,9 +36,6 @@ import java.util.Collection;
|
|||
import com.sun.star.lang.EventObject;
|
||||
import com.sun.star.lang.XEventListener;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import java.lang.ClassCastException;
|
||||
import com.sun.star.uno.XInterface;
|
||||
import java.util.AbstractList;
|
||||
|
||||
/**
|
||||
* This class is a container for interfaces.
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
package com.sun.star.lib.uno.helper;
|
||||
import com.sun.star.uno.Type;
|
||||
import com.sun.star.lang.EventObject;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Iterator;
|
||||
|
|
|
@ -49,8 +49,6 @@ import com.sun.star.beans.XPropertySetInfo;
|
|||
import com.sun.star.beans.XFastPropertySet;
|
||||
import com.sun.star.beans.PropertyVetoException;
|
||||
import com.sun.star.beans.XMultiPropertySet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Iterator;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
************************************************************************/
|
||||
|
||||
package com.sun.star.lib.uno.helper;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
|
|
@ -32,7 +32,6 @@ package com.sun.star.lib.uno.helper;
|
|||
import java.lang.ref.WeakReference;
|
||||
import com.sun.star.uno.XAdapter;
|
||||
import com.sun.star.uno.XReference;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
|
|
|
@ -33,9 +33,7 @@ import com.sun.star.uno.XWeak;
|
|||
import com.sun.star.uno.XAdapter;
|
||||
import com.sun.star.lang.XTypeProvider;
|
||||
import com.sun.star.uno.Type;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Vector;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import java.util.Map;
|
||||
import java.util.Hashtable;
|
||||
|
||||
|
|
|
@ -31,13 +31,9 @@
|
|||
package com.sun.star.comp.bridgefactory;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
import com.sun.star.lang.XEventListener;
|
||||
import com.sun.star.lang.XComponent;
|
||||
|
||||
import com.sun.star.bridge.BridgeExistsException;
|
||||
import com.sun.star.bridge.XBridge;
|
||||
import com.sun.star.bridge.XBridgeFactory;
|
||||
|
|
|
@ -33,7 +33,6 @@ package com.sun.star.comp.connections;
|
|||
import com.sun.star.bridge.XInstanceProvider;
|
||||
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.sun.star.comp.loader.FactoryHelper;
|
|||
import com.sun.star.connection.XConnection;
|
||||
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
package com.sun.star.comp.loader;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
|
@ -42,26 +40,18 @@ import com.sun.star.loader.CannotActivateFactoryException;
|
|||
import com.sun.star.loader.XImplementationLoader;
|
||||
|
||||
import com.sun.star.registry.CannotRegisterImplementationException;
|
||||
import com.sun.star.registry.RegistryKeyType;
|
||||
import com.sun.star.registry.RegistryValueType;
|
||||
import com.sun.star.registry.InvalidRegistryException;
|
||||
import com.sun.star.registry.InvalidValueException;
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
import com.sun.star.registry.XSimpleRegistry;
|
||||
|
||||
import com.sun.star.lang.XSingleComponentFactory;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.ServiceNotRegisteredException;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
import com.sun.star.lang.XInitialization;
|
||||
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
import com.sun.star.util.XMacroExpander;
|
||||
|
||||
import com.sun.star.uno.XInterface;
|
||||
import com.sun.star.uno.Type;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
|
@ -69,8 +59,6 @@ import com.sun.star.lib.util.StringHelper;
|
|||
|
||||
import com.sun.star.uno.AnyConverter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
/**
|
||||
* The <code>JavaLoader</code> class provides the functionality of the <code>com.sun.star.loader.Java</code>
|
||||
|
|
|
@ -33,11 +33,7 @@ package com.sun.star.comp.loader;
|
|||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.ServiceNotRegisteredException;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
|
||||
import com.sun.star.uno.RuntimeException;
|
||||
import com.sun.star.uno.Exception;
|
||||
|
||||
public class JavaLoaderFactory implements XSingleServiceFactory, XServiceInfo {
|
||||
|
||||
|
|
|
@ -36,8 +36,6 @@ import com.sun.star.uno.XComponentContext;
|
|||
import com.sun.star.container.XSet;
|
||||
import com.sun.star.container.XContentEnumerationAccess;
|
||||
import com.sun.star.container.XEnumeration;
|
||||
import com.sun.star.container.XEnumerationAccess;
|
||||
import com.sun.star.container.XElementAccess;
|
||||
|
||||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.lang.XEventListener;
|
||||
|
@ -51,12 +49,8 @@ import com.sun.star.lang.XMultiComponentFactory;
|
|||
import com.sun.star.registry.XRegistryKey;
|
||||
import com.sun.star.registry.XSimpleRegistry;
|
||||
|
||||
import com.sun.star.loader.CannotActivateFactoryException;
|
||||
import com.sun.star.loader.XImplementationLoader;
|
||||
|
||||
import com.sun.star.lang.XEventListener;
|
||||
//import com.sun.star.lang.EventObject;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,13 +31,8 @@
|
|||
package com.sun.star.comp.urlresolver;
|
||||
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
|
||||
import com.sun.star.bridge.BridgeExistsException;
|
||||
import com.sun.star.bridge.XBridge;
|
||||
import com.sun.star.bridge.XBridgeFactory;
|
||||
import com.sun.star.bridge.XInstanceProvider;
|
||||
import com.sun.star.bridge.XUnoUrlResolver;
|
||||
|
||||
import com.sun.star.comp.loader.FactoryHelper;
|
||||
|
|
|
@ -29,11 +29,7 @@
|
|||
************************************************************************/
|
||||
package com.sun.star.lib.connections.pipe;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.Enumeration;
|
||||
|
|
|
@ -38,8 +38,6 @@ import com.sun.star.connection.XConnection;
|
|||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
|
||||
/**
|
||||
* A component that implements the <code>XAcceptor</code> interface.
|
||||
|
|
|
@ -38,9 +38,6 @@ import com.sun.star.connection.XConnector;
|
|||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* A component that implements the <code>XConnector</code> interface.
|
||||
|
|
|
@ -34,10 +34,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
|
@ -53,15 +49,10 @@ import com.sun.star.lib.util.DisposeNotifier;
|
|||
import com.sun.star.bridge.XBridge;
|
||||
import com.sun.star.bridge.XInstanceProvider;
|
||||
|
||||
import com.sun.star.comp.loader.FactoryHelper;
|
||||
|
||||
import com.sun.star.connection.XConnection;
|
||||
import com.sun.star.container.NoSuchElementException;
|
||||
import com.sun.star.lang.EventObject;
|
||||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.lang.XEventListener;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XSingleServiceFactory;
|
||||
import com.sun.star.lang.DisposedException;
|
||||
|
||||
import com.sun.star.lib.uno.environments.java.java_environment;
|
||||
|
@ -76,7 +67,6 @@ import com.sun.star.lib.uno.environments.remote.IThreadPool;
|
|||
import com.sun.star.lib.uno.typedesc.MethodDescription;
|
||||
import com.sun.star.lib.uno.typedesc.TypeDescription;
|
||||
|
||||
import com.sun.star.registry.XRegistryKey;
|
||||
|
||||
import com.sun.star.uno.IBridge;
|
||||
import com.sun.star.uno.IEnvironment;
|
||||
|
|
|
@ -30,13 +30,6 @@
|
|||
|
||||
package com.sun.star.lib.uno.environments.remote;
|
||||
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
/**
|
||||
* This class implements a java thread pool.
|
||||
* <p>
|
||||
|
|
|
@ -31,13 +31,11 @@
|
|||
package com.sun.star.lib.uno.environments.remote;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import com.sun.star.lib.uno.typedesc.MethodDescription;
|
||||
import com.sun.star.uno.Any;
|
||||
|
|
|
@ -31,12 +31,6 @@
|
|||
package com.sun.star.lib.uno.environments.remote;
|
||||
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The <code>JobQueue</code> implements a queue for jobs.
|
||||
* For every jobs thread id exists a job queue which is registered
|
||||
|
|
|
@ -30,13 +30,8 @@
|
|||
package com.sun.star.lib.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/** Helper functions to locate and load native files.
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ import java.lang.reflect.Constructor;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package com.sun.star.uno;
|
||||
import com.sun.star.lang.IllegalArgumentException;
|
||||
|
||||
/** This class provides static methods which aim at exploring the contents of an
|
||||
* Any and extracting its value. All public methods take an Object argument that
|
||||
* either is the immediate object, such as Boolean, Type, interface implementation,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* Supplies information about UNO types.
|
||||
|
|
|
@ -63,42 +63,6 @@ Simstr::Simstr(const char * str_)
|
|||
}
|
||||
}
|
||||
|
||||
Simstr::Simstr(const char * txt, int anzahl)
|
||||
{
|
||||
int txtlen = txt != 0 ? strlen(txt) : 0;
|
||||
if (txt == 0 || anzahl < 1 || long(anzahl) * txtlen > INT_MAX)
|
||||
{
|
||||
len = 0;
|
||||
sz = new char[1];
|
||||
*sz = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = anzahl * txtlen;
|
||||
sz = new char[len+1];
|
||||
for (int i = 0; i < anzahl; i++)
|
||||
memcpy(sz + (i*txtlen), txt, txtlen);
|
||||
sz[len] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Simstr::Simstr(char c, int anzahl)
|
||||
{
|
||||
if (anzahl < 1)
|
||||
{
|
||||
len = 0;
|
||||
sz = new char[1];
|
||||
*sz = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = anzahl;
|
||||
sz = new char[len+1];
|
||||
memset(sz,c,anzahl);
|
||||
sz[len] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Simstr::Simstr( const char * anybytes,
|
||||
int firstBytesPos,
|
||||
int nrOfBytes)
|
||||
|
@ -149,18 +113,6 @@ Simstr::~Simstr()
|
|||
delete [] sz;
|
||||
}
|
||||
|
||||
char &
|
||||
Simstr::ch(int n)
|
||||
{
|
||||
static char nullCh = NULCH;
|
||||
nullCh = NULCH;
|
||||
if (n >= long(len) || n < 0)
|
||||
return nullCh;
|
||||
else
|
||||
return sz[unsigned(n)];
|
||||
}
|
||||
|
||||
|
||||
Simstr
|
||||
Simstr::operator+(const Simstr & S) const
|
||||
{
|
||||
|
@ -208,97 +160,8 @@ Simstr::operator>=(const Simstr & S) const
|
|||
|
||||
// ************** LIST - Funktionen *****************
|
||||
|
||||
|
||||
// Einzelzugriff
|
||||
|
||||
char
|
||||
Simstr::get(int n) const { return (n >= len || n < 0) ? 0 : sz[n]; }
|
||||
|
||||
char
|
||||
Simstr::get_front() const { return sz[0]; }
|
||||
|
||||
char
|
||||
Simstr::get_back() const { return len ? sz[len-1] : 0; }
|
||||
|
||||
Simstr
|
||||
Simstr::get(int startPos, int anzahl) const
|
||||
{
|
||||
if (startPos >= len || startPos < 0 || anzahl < 1)
|
||||
return "";
|
||||
|
||||
int anz = len - startPos < anzahl ? len - startPos : anzahl;
|
||||
|
||||
Simstr ret(' ',anz);
|
||||
memcpy(ret.sz, sz+startPos, anz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::get_front(int anzahl) const
|
||||
{
|
||||
int anz = len < anzahl ? len : anzahl;
|
||||
if (anz < 1)
|
||||
return "";
|
||||
|
||||
Simstr ret(' ',anz);
|
||||
memcpy(ret.sz, sz, anz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::get_back(int anzahl) const
|
||||
{
|
||||
int anz = len < anzahl ? len : anzahl;
|
||||
if (anz < 1)
|
||||
return "";
|
||||
int start = len-anz;
|
||||
|
||||
Simstr ret(' ',anz);
|
||||
memcpy(ret.sz, sz+start, anz);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::get_first_token(char c) const
|
||||
{
|
||||
int posc = pos_first(c);
|
||||
if (posc != NO_POS)
|
||||
return get_front(posc);
|
||||
else
|
||||
return sz;
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::get_last_token(char c) const
|
||||
{
|
||||
int posc = pos_last(c);
|
||||
if (posc != NO_POS)
|
||||
return get_back(len-posc-1);
|
||||
else
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Insert
|
||||
|
||||
void
|
||||
Simstr::insert(int pos, char c)
|
||||
{
|
||||
if (pos < 0 || pos > len)
|
||||
return;
|
||||
|
||||
char * result = new char[len+2];
|
||||
|
||||
memcpy(result,sz,pos);
|
||||
result[pos] = c;
|
||||
memcpy(result+pos+1,sz+pos,len-pos+1);
|
||||
|
||||
delete [] sz;
|
||||
sz = result;
|
||||
len++;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::push_front(char c)
|
||||
{
|
||||
|
@ -326,23 +189,6 @@ Simstr::push_back(char c)
|
|||
len++;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::insert(int pos, const Simstr & S)
|
||||
{
|
||||
if (pos < 0 || pos > len)
|
||||
return;
|
||||
|
||||
char * result = new char[len+1+S.len];
|
||||
|
||||
memcpy(result,sz,pos);
|
||||
memcpy(result+pos,S.sz,S.len);
|
||||
memcpy(result+pos+S.len,sz+pos,len-pos+1);
|
||||
|
||||
delete [] sz;
|
||||
sz = result;
|
||||
len += S.len;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::push_front(const Simstr & S)
|
||||
{
|
||||
|
@ -400,167 +246,6 @@ Simstr::remove_trailing_blanks()
|
|||
remove ( newlen+1, len-newlen);
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::pop_front(int anzahl)
|
||||
{
|
||||
if (anzahl < 1)
|
||||
return;
|
||||
int anz = len < anzahl ? len : anzahl;
|
||||
|
||||
char * result = new char[len-anz+1];
|
||||
|
||||
memcpy(result,sz+anz,len-anz+1);
|
||||
|
||||
delete [] sz;
|
||||
sz = result;
|
||||
len -= anz;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::pop_back(int anzahl)
|
||||
{
|
||||
if (anzahl < 1)
|
||||
return;
|
||||
|
||||
int anz = len < anzahl ? len : anzahl;
|
||||
|
||||
char * result = new char[len-anz+1];
|
||||
|
||||
memcpy(result,sz,len-anz);
|
||||
result[len-anz] = 0;
|
||||
|
||||
delete [] sz;
|
||||
sz = result;
|
||||
len -= anz;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::rem_back_from(int removeStartPos)
|
||||
{
|
||||
if (removeStartPos != NO_POS)
|
||||
pop_back(len-removeStartPos);
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::remove_all(char c)
|
||||
{
|
||||
if (!len)
|
||||
return;
|
||||
char * result = new char[len];
|
||||
int i,j=0;
|
||||
for (i = 0; i < len; i++)
|
||||
if (sz[i] != c)
|
||||
result[j++] = sz[i];
|
||||
|
||||
delete [] sz;
|
||||
sz = new char[j+1];
|
||||
memcpy(sz,result,j);
|
||||
sz[j] = 0;
|
||||
len = j;
|
||||
delete [] result;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::remove_all(const Simstr & S)
|
||||
{
|
||||
int pos;
|
||||
while ( (pos=pos_first(S)) != NO_POS )
|
||||
remove(pos,S.len);
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::strip(char c)
|
||||
{
|
||||
int start = 0;
|
||||
if (c == ' ')
|
||||
{ // Sonderbehandlung: SPC entfernt auch TABs:
|
||||
while ( start < len
|
||||
? sz[start] == ' '
|
||||
|| sz[start] == '\t'
|
||||
: false )
|
||||
start++;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (start < len && sz[start] == c)
|
||||
start++;
|
||||
}
|
||||
|
||||
int ende = len-1;
|
||||
if (c == ' ')
|
||||
{ // Sonderbehandlung: SPC entfernt auch TABs:
|
||||
while ( ende >= start
|
||||
? sz[ende] == ' '
|
||||
|| sz[ende] == '\t'
|
||||
: false )
|
||||
ende--;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (ende >= start && sz[ende] == c)
|
||||
ende--;
|
||||
}
|
||||
*this = get(start,ende-start+1);
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::empty()
|
||||
{
|
||||
if (len > 0)
|
||||
{
|
||||
delete [] sz;
|
||||
sz = new char[1];
|
||||
*sz = 0;
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::take_first_token(char c)
|
||||
{
|
||||
Simstr ret;
|
||||
int pos = pos_first(c);
|
||||
if (pos != NO_POS)
|
||||
{
|
||||
ret = get_front(pos);
|
||||
pop_front(pos+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = sz;
|
||||
delete [] sz;
|
||||
sz = new char[1];
|
||||
*sz = NULCH;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Simstr
|
||||
Simstr::take_last_token(char c)
|
||||
{
|
||||
Simstr ret;
|
||||
int pos = pos_last(c);
|
||||
if (pos != NO_POS)
|
||||
{
|
||||
ret = get_back(len-pos-1);
|
||||
pop_back(len-pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = sz;
|
||||
delete [] sz;
|
||||
sz = new char[1];
|
||||
*sz = NULCH;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Find
|
||||
|
||||
int
|
||||
|
@ -574,21 +259,6 @@ Simstr::pos_first(char c) const
|
|||
return i;
|
||||
}
|
||||
|
||||
int
|
||||
Simstr::pos_first_after( char c,
|
||||
int startSearchPos) const
|
||||
{
|
||||
int i = 0;
|
||||
if (startSearchPos >= i)
|
||||
i = startSearchPos+1;
|
||||
for (; i < len ? sz[i] != c : false; i++) ;
|
||||
if (i >= len)
|
||||
return NO_POS;
|
||||
else
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Simstr::pos_last(char c) const
|
||||
{
|
||||
|
@ -600,43 +270,6 @@ Simstr::pos_last(char c) const
|
|||
return i;
|
||||
}
|
||||
|
||||
int
|
||||
Simstr::pos_first(const Simstr & S) const
|
||||
{
|
||||
char * ptr = strstr(sz,S.sz);
|
||||
if (ptr)
|
||||
return int(ptr-sz);
|
||||
else
|
||||
return NO_POS;
|
||||
}
|
||||
|
||||
int
|
||||
Simstr::pos_last(const Simstr & S) const
|
||||
{
|
||||
Simstr vgl;
|
||||
int i;
|
||||
for (i = len-S.len; i >= 0 ; i--)
|
||||
{
|
||||
vgl = get(i,S.len);
|
||||
if (vgl == S)
|
||||
break;
|
||||
}
|
||||
if (i >= 0)
|
||||
return i;
|
||||
else
|
||||
return NO_POS;
|
||||
}
|
||||
|
||||
int
|
||||
Simstr::count(char c) const
|
||||
{
|
||||
int ret = 0;
|
||||
for (int i =0; i < len; i++)
|
||||
if (sz[i] == c)
|
||||
ret++;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
Simstr::is_no_text() const
|
||||
{
|
||||
|
@ -652,34 +285,6 @@ Simstr::is_no_text() const
|
|||
|
||||
// Change
|
||||
|
||||
void
|
||||
Simstr::replace(int pos, char c)
|
||||
{
|
||||
if (pos < 0 || pos >= len)
|
||||
return;
|
||||
else
|
||||
sz[unsigned(pos)] = c;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::replace(int startPos, int anzahl, const Simstr & S)
|
||||
{
|
||||
if (startPos >= len || startPos < 0 || anzahl < 1)
|
||||
return;
|
||||
|
||||
int anz = len - startPos < anzahl ? len - startPos : anzahl;
|
||||
|
||||
char * result = new char[len-anz+S.len+1];
|
||||
|
||||
memcpy(result,sz,startPos);
|
||||
memcpy(result+startPos, S.sz, S.len);
|
||||
memcpy(result+startPos+S.len, sz+startPos+anz, len-startPos-anz+1);
|
||||
|
||||
delete [] sz;
|
||||
sz = result;
|
||||
len = len-anz+S.len;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::replace_all(char oldCh, char newCh)
|
||||
{
|
||||
|
@ -688,33 +293,6 @@ Simstr::replace_all(char oldCh, char newCh)
|
|||
sz[i] = newCh;
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::replace_all(const Simstr & oldS, const Simstr & newS)
|
||||
{
|
||||
Simstr vgl;
|
||||
int i = 0;
|
||||
while (i <= len-oldS.len)
|
||||
{
|
||||
vgl = get(i,oldS.len);
|
||||
if (strcmp(vgl.sz,oldS.sz) == 0)
|
||||
{
|
||||
replace(i,oldS.len,newS);
|
||||
i += newS.len;
|
||||
}
|
||||
else
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Simstr::to_lower()
|
||||
{
|
||||
for (int i = 0; i < len; i++)
|
||||
sz[i] = (char) tolower(sz[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Simstr addition
|
||||
Simstr
|
||||
operator+(const char * str, const Simstr & S)
|
||||
|
|
|
@ -39,12 +39,6 @@ class Simstr
|
|||
// Constructors, destructor, '=' and typecasts
|
||||
Simstr(
|
||||
const char * str = 0);
|
||||
Simstr( // Creates Simstr of 'anzahl' times 'txt'.
|
||||
const char * txt,
|
||||
int anzahl);
|
||||
Simstr(
|
||||
char c, // Creates Simstr of 'anzahl' times 'c'.
|
||||
int anzahl);
|
||||
Simstr( // Creates Simstr out of a copy of the described bytes within 'anyBytes'.
|
||||
// Adds a '\0' at the end.
|
||||
const char * anybytes,
|
||||
|
@ -63,8 +57,6 @@ class Simstr
|
|||
// nevertheless THAT WILL BE NOT CHANGED!
|
||||
// Typecasts to 'const char*' are performed automatically.
|
||||
int l() const; // Length of string without '\0' at end.
|
||||
char & ch( int n); // Reference to sz[n]. Allows change of this char.
|
||||
// !!! No safety, if n is out of the allowed range!
|
||||
Simstr operator+(
|
||||
const Simstr & S) const;
|
||||
Simstr & operator+=(
|
||||
|
@ -86,25 +78,11 @@ class Simstr
|
|||
|
||||
|
||||
// 'List of characters' - functions
|
||||
// get - functions
|
||||
char get( int n) const;
|
||||
char get_front() const;
|
||||
char get_back() const;
|
||||
Simstr get( int startPos,
|
||||
int anzahl) const;
|
||||
Simstr get_front(
|
||||
int anzahl) const;
|
||||
Simstr get_back(
|
||||
int anzahl) const;
|
||||
// insert - functions
|
||||
void insert( int pos,
|
||||
char c);
|
||||
void push_front(
|
||||
char c);
|
||||
void push_back(
|
||||
char c);
|
||||
void insert( int pos,
|
||||
const Simstr & S);
|
||||
void push_front(
|
||||
const Simstr & S);
|
||||
void push_back(
|
||||
|
@ -114,64 +92,24 @@ class Simstr
|
|||
int pos,
|
||||
int anzahl = 1);
|
||||
void remove_trailing_blanks();
|
||||
void pop_front(
|
||||
int anzahl = 1);
|
||||
void pop_back(
|
||||
int anzahl = 1);
|
||||
void rem_back_from(
|
||||
int removeStartPos);
|
||||
void remove_all(
|
||||
char c);
|
||||
void remove_all( // Starts search left.
|
||||
const Simstr & S);
|
||||
void strip(char c); // Removes all characters == c from front and back.
|
||||
// c == ' ' removes also TABs !!!
|
||||
void empty(); // Changes object to the value "".
|
||||
|
||||
// search functions
|
||||
int pos_first(
|
||||
char c) const;
|
||||
int pos_first_after( // Sucht ab erstem char nach startSearchPos
|
||||
char c,
|
||||
int startSearchPos) const;
|
||||
int pos_last(
|
||||
char c) const;
|
||||
int pos_first(
|
||||
const Simstr & S) const;
|
||||
int pos_last(
|
||||
const Simstr & S) const;
|
||||
int count(
|
||||
char c) const;
|
||||
bool is_empty() const; // Only true if object == "".
|
||||
bool is_no_text() const; // String may contain spaces or tabs.
|
||||
|
||||
// substitution functions
|
||||
void replace(
|
||||
int pos,
|
||||
char c);
|
||||
void replace(
|
||||
int startPos,
|
||||
int anzahl,
|
||||
const Simstr & S);
|
||||
void replace_all(
|
||||
char oldCh,
|
||||
char newCh);
|
||||
void replace_all(
|
||||
const Simstr & oldS,
|
||||
const Simstr & newS);
|
||||
void to_lower();
|
||||
|
||||
// token functions
|
||||
// get...-functions return the token, separated by char 'c' and leave the object unchanged.
|
||||
// take...-functions return the same, but remove the token and the corresponding separator from the object.
|
||||
Simstr get_first_token(
|
||||
char c) const;
|
||||
Simstr get_last_token(
|
||||
char c) const;
|
||||
Simstr take_first_token(
|
||||
char c);
|
||||
Simstr take_last_token(
|
||||
char c);
|
||||
|
||||
private:
|
||||
char * sz;
|
||||
|
|
|
@ -228,16 +228,6 @@ HtmlCreator::Write_ReferenceDocu( const Simstr & i_sName,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
HtmlCreator::PrintH1( const char * i_pText)
|
||||
{
|
||||
static const char sH1a[] = "<H1 ALIGN=CENTER>";
|
||||
static const char sH1e[] = "</H1>";
|
||||
WriteStr(sH1a);
|
||||
WriteStr(i_pText);
|
||||
WriteStr(sH1e);
|
||||
}
|
||||
|
||||
void
|
||||
HtmlCreator::StartRow()
|
||||
{
|
||||
|
|
|
@ -76,8 +76,6 @@ class HtmlCreator
|
|||
const Simstr & i_sRole,
|
||||
const Simstr & i_sTitle );
|
||||
private:
|
||||
void PrintH1(
|
||||
const char * i_pText );
|
||||
void StartRow();
|
||||
void FinishRow();
|
||||
void StartCell(
|
||||
|
|
Loading…
Reference in a new issue