Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtranslator.cpp File Reference

(24c731eb272bff5b360d62001eab65a5dd28cd50)

#include "qplatformdefs.h"
#include "qtranslator.h"
#include "qfileinfo.h"
#include "qstring.h"
#include "qstringlist.h"
#include "qcoreapplication.h"
#include "qcoreapplication_p.h"
#include "qdatastream.h"
#include "qendian.h"
#include "qfile.h"
#include "qalgorithms.h"
#include "qtranslator_p.h"
#include "qlocale.h"
#include "qlogging.h"
#include "qloggingcategory.h"
#include "qdebug.h"
#include "qresource.h"
#include <stdlib.h>
#include <new>
#include "qobject_p.h"
#include <vector>
#include <memory>
#include <QtCore/qmutex.h>
#include "moc_qtranslator.cpp"
Include dependency graph for qtranslator.cpp:

Go to the source code of this file.

Classes

class  QTranslatorPrivate

Namespaces

namespace  QT_BEGIN_NAMESPACE
 Combined button and popup list for selecting options.

Enumerations

enum  QT_BEGIN_NAMESPACE::Tag {
  QT_BEGIN_NAMESPACE::Tag_End = 1 , QT_BEGIN_NAMESPACE::Tag_SourceText16 , QT_BEGIN_NAMESPACE::Tag_Translation , QT_BEGIN_NAMESPACE::Tag_Context16 ,
  QT_BEGIN_NAMESPACE::Tag_Obsolete1 , QT_BEGIN_NAMESPACE::Tag_SourceText , QT_BEGIN_NAMESPACE::Tag_Context , QT_BEGIN_NAMESPACE::Tag_Comment ,
  QT_BEGIN_NAMESPACE::Tag_Obsolete2 , QT_BEGIN_NAMESPACE::Tag_End = 1 , QT_BEGIN_NAMESPACE::Tag_SourceText16 , QT_BEGIN_NAMESPACE::Tag_Translation ,
  QT_BEGIN_NAMESPACE::Tag_Context16 , QT_BEGIN_NAMESPACE::Tag_Obsolete1 , QT_BEGIN_NAMESPACE::Tag_SourceText , QT_BEGIN_NAMESPACE::Tag_Context ,
  QT_BEGIN_NAMESPACE::Tag_Comment , QT_BEGIN_NAMESPACE::Tag_Obsolete2
}
enum  QT_BEGIN_NAMESPACE::Tag {
  QT_BEGIN_NAMESPACE::Tag_End = 1 , QT_BEGIN_NAMESPACE::Tag_SourceText16 , QT_BEGIN_NAMESPACE::Tag_Translation , QT_BEGIN_NAMESPACE::Tag_Context16 ,
  QT_BEGIN_NAMESPACE::Tag_Obsolete1 , QT_BEGIN_NAMESPACE::Tag_SourceText , QT_BEGIN_NAMESPACE::Tag_Context , QT_BEGIN_NAMESPACE::Tag_Comment ,
  QT_BEGIN_NAMESPACE::Tag_Obsolete2 , QT_BEGIN_NAMESPACE::Tag_End = 1 , QT_BEGIN_NAMESPACE::Tag_SourceText16 , QT_BEGIN_NAMESPACE::Tag_Translation ,
  QT_BEGIN_NAMESPACE::Tag_Context16 , QT_BEGIN_NAMESPACE::Tag_Obsolete1 , QT_BEGIN_NAMESPACE::Tag_SourceText , QT_BEGIN_NAMESPACE::Tag_Context ,
  QT_BEGIN_NAMESPACE::Tag_Comment , QT_BEGIN_NAMESPACE::Tag_Obsolete2
}

Functions

static QString dotQmLiteral ()
static bool match (const uchar *found, uint foundLen, const char *target, uint targetLen)
static void elfHash_continue (const char *name, uint &h)
static void elfHash_finish (uint &h)
static uint elfHash (const char *name)
static bool isValidNumerusRules (const uchar *rules, uint rulesSize)
static uint numerusHelper (int n, const uchar *rules, uint rulesSize)
static quint8 read8 (const uchar *data)
static quint16 read16 (const uchar *data)
static quint32 read32 (const uchar *data)
static QString getMessage (const uchar *m, const uchar *end, const char *context, const char *sourceText, const char *comment, uint numerus)

Variables

static const int MagicLength = 16
static const uchar magic [MagicLength]

Function Documentation

◆ dotQmLiteral()

QString dotQmLiteral ( )
inlinestatic

Definition at line 67 of file qtranslator.cpp.

◆ elfHash()

uint elfHash ( const char * name)
static

Definition at line 98 of file qtranslator.cpp.

References elfHash_continue(), and elfHash_finish().

Referenced by QTranslatorPrivate::do_translate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ elfHash_continue()

void elfHash_continue ( const char * name,
uint & h )
static

Definition at line 78 of file qtranslator.cpp.

Referenced by elfHash().

Here is the caller graph for this function:

◆ elfHash_finish()

void elfHash_finish ( uint & h)
static

Definition at line 92 of file qtranslator.cpp.

Referenced by elfHash().

Here is the caller graph for this function:

◆ getMessage()

QString getMessage ( const uchar * m,
const uchar * end,
const char * context,
const char * sourceText,
const char * comment,
uint numerus )
static

◆ isValidNumerusRules()

bool isValidNumerusRules ( const uchar * rules,
uint rulesSize )
static

Definition at line 112 of file qtranslator.cpp.

◆ match()

bool match ( const uchar * found,
uint foundLen,
const char * target,
uint targetLen )
static

Definition at line 69 of file qtranslator.cpp.

◆ numerusHelper()

uint numerusHelper ( int n,
const uchar * rules,
uint rulesSize )
static

Definition at line 180 of file qtranslator.cpp.

◆ read16()

quint16 read16 ( const uchar * data)
static

Definition at line 781 of file qtranslator.cpp.

◆ read32()

quint32 read32 ( const uchar * data)
static

Definition at line 786 of file qtranslator.cpp.

◆ read8()

quint8 read8 ( const uchar * data)
static

Definition at line 776 of file qtranslator.cpp.

Variable Documentation

◆ magic

const uchar magic
static
Initial value:
= {
0x3c, 0xb8, 0x64, 0x18, 0xca, 0xef, 0x9c, 0x95,
0xcd, 0x21, 0x1c, 0xbf, 0x60, 0xa1, 0xbd, 0xdd
}

Definition at line 62 of file qtranslator.cpp.

◆ MagicLength

const int MagicLength = 16
static

Definition at line 61 of file qtranslator.cpp.

Referenced by QTranslatorPrivate::do_load(), and QTranslatorPrivate::do_load().