Skip to content

Commit

Permalink
Adds a method to determine if a language key is undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Nov 18, 2011
1 parent 01c25aa commit ac795d5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mythtv/libs/libmythbase/iso639.h
Expand Up @@ -53,6 +53,13 @@ static inline QString iso639_key_to_str3(int code)
return QString(str);
}

/// Returns true if the key is 0, 0xFFFFFF, or 'und'
static inline bool iso639_is_key_undefined(int code)
{
int bits = code & 0xFFFFFF;
return (0 == bits) || (0xFFFFFF == bits) || (0x756E64 == bits);
}

static inline int iso639_str3_to_key(const unsigned char *iso639_2)
{
return (iso639_2[0]<<16)|(iso639_2[1]<<8)|iso639_2[2];
Expand Down

0 comments on commit ac795d5

Please sign in to comment.