---
name: "ACE_NS_String"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_NS_String"
---

# ACE\_NS\_String(3)

This class and ACE\_NS\_Internal are used as Adapters to work with the Map\_Manager.

## NAME

ACE\_NS\_String -  This class and ACE\_NS\_Internal are used as Adapters to work with the Map\_Manager.

## SYNOPSIS

```
#include <ACE/Local_Name_Space.h>
class ACE_NS_String
{
  public:
    ACE_NS_String (void);
    ACE_NS_String (
        ACE_USHORT16 *dst,
        const ACE_USHORT16 *src,
        size_t len
        );
    ACE_NS_String (const ACE_WString &);
    operator ACE_WString () const;
    char *char_rep (void) const;
    int strstr (const ACE_NS_String &) const;
    int operator == (const ACE_NS_String &) const;
    int operator != (const ACE_NS_String &) const;
    size_t len (void) const;
    ACE_USHORT16 *fast_rep (void) const;
    size_t hash (void) const;
  private:
    size_t len_;
    ACE_USHORT16 *rep_;
};
```

## DESCRIPTION

In order to work correctly, this class must be able to convert back and forth with ACE\_WStrings.  Note that this class must not have a destructor since otherwise we'll have problems...

## Initialization.

```
ACE_NS_String (void);
```

Default "no-op" constructor.

```
ACE_NS_String (
    ACE_USHORT16 *dst,
    const ACE_USHORT16 *src,
    size_t len
    );
```

Initialization method.

```
ACE_NS_String (const ACE_WString &);
```

Converts an ACE\_WString to an ACE\_NS\_String;

```
operator ACE_WString () const;
```

Converts an ACE\_NS\_String to fresh copy of an ACE\_WString;

```
char *char_rep (void) const;
```

Return the ASCII character representation.

```
int strstr (const ACE_NS_String &) const;
```

Matches on substrings.

```
int operator == (const ACE_NS_String &) const;
```

Compare an ACE\_NS\_String.

```
int operator != (const ACE_NS_String &) const;
```

Compare an ACE\_NS\_String.

```
size_t len (void) const;
```

Returns length of the string

```
ACE_USHORT16 *fast_rep (void) const;
```

Returns the underlying representation.

```
size_t hash (void) const;
```

Returns a hash value for this string.

## AUTHOR

Prashant Jain (pjain@cs.wustl.edu), Irfan Pyarali (irfan@wuerl.wustl.edu), and Douglas C. Schmidt (schmidt@cs.wustl.edu).

## LIBRARY

ACE
